Gireesha Devara has Published 249 Articles

What does ** (double star) and * (star) do for parameters in Python?

Gireesha Devara

Gireesha Devara

Updated on 09-Sep-2023 22:59:21

3K+ Views

While creating a function the single asterisk (*) defined to accept and allow users to pass any number of positional arguments. And in the same way the double asterisk (**) defined to accept any number of keyword arguments. The single asterisk (*) can be used when we are not sure ... Read More

What does the Star operator mean in Python?

Gireesha Devara

Gireesha Devara

Updated on 09-Sep-2023 22:56:14

17K+ Views

The asterisk (*) operator in Python has more than one meaning attached to it. We can use it as a Multiplication operator, Repetition operator, used for Unpacking the iterables, and Used as function *args. Single asterisk as used in function declaration allows variable number of arguments passed from calling environment. ... Read More

What does the Double Star operator mean in Python?

Gireesha Devara

Gireesha Devara

Updated on 09-Sep-2023 15:22:05

7K+ Views

The double star/asterisk (*) operator has more than one meaning in Python. We can use it as a exponential operator, used as function *kwargs, unpacking the iterables, and used to Merge the Dictionaries. Exponential operator For numeric data the double asterisk (**) is used as an exponential operator. Let's take ... Read More

What is Python equivalent of the ! operator?

Gireesha Devara

Gireesha Devara

Updated on 09-Sep-2023 09:48:50

2K+ Views

In some languages like C / C++ the "!" symbol is used as a logical NOT operator. !x it returns true if x is false else returns false. The equivalent of this "!" operator in python is logical NOT, It also returns true if the operand is false and ... Read More

Python program to display half diamond pattern of numbers with star border

Gireesha Devara

Gireesha Devara

Updated on 29-Aug-2023 14:33:02

420 Views

A half-diamond pattern is a geometric pattern that resembles the shape of a diamond, but only covers half of the diamond.  Diamond patterns can be created using loops in programming. By controlling the loops and the number of characters printed in each row, we can modify the pattern to achieve ... Read More

Python program to determine if the given IPv4 Address is reserved using ipaddress module

Gireesha Devara

Gireesha Devara

Updated on 29-Aug-2023 14:32:00

95 Views

In the traditional IPv4 addressing scheme, IP addresses are divided into five classes: A, B, C, D, and E. Class E addresses, ranging from 240.0.0.0 to 255.255.255.255, are designated for particular purposes and are not intended for general use in the current internet infrastructure. As a result, Class E addresses ... Read More

Python program to determine if the given IP Address is Public or Private using ipaddress module

Gireesha Devara

Gireesha Devara

Updated on 29-Aug-2023 14:31:04

548 Views

In computer networking, IP addresses are used to uniquely identify devices connected to a network. IP addresses can be classified as either public or private. Public IP addresses are assigned to devices that are directly connected to the Internet. They are globally routable and can be accessed from anywhere on ... Read More

Python Program to create an OTP by squaring and concatenating the odd digits of a number

Gireesha Devara

Gireesha Devara

Updated on 29-Aug-2023 14:30:09

93 Views

The task is to create a One-Time Password (OTP) by squaring and concatenating the odd digits of a given number.  Input Output Scenarios Following are the input-output scenarios for creating an OTP by squaring and concatenating the odd digits of a number Input number = 123456789 Output OTP: 19254981 ... Read More

Python program to create a list centered on zero

Gireesha Devara

Gireesha Devara

Updated on 29-Aug-2023 14:29:15

84 Views

Creating a list centered on zero involves generating a sequence of numbers where zero is positioned in the middle of the list. While the size of the list can be customized, it is often preferred to use an odd number to ensure symmetrical distribution of elements around zero. In this ... Read More

Python program to count the number of characters in a String

Gireesha Devara

Gireesha Devara

Updated on 29-Aug-2023 14:27:34

2K+ Views

Strings in Python can contain any sequence of characters, including letters, numbers, symbols, and whitespace. It can represent text, numbers, or any other type of data that can be represented as a sequence of characters. In Python, strings are enclosed in single quotes ('') or double quotes (""). Multiline strings ... Read More

1 2 3 4 5 ... 25 Next
Advertisements