Gireesha Devara has Published 248 Articles

What does the Star operator mean in Python?

Gireesha Devara

Gireesha Devara

Updated on 30-Apr-2025 17:40:21

21K+ Views

The asterisk (*) operator in Python has more than one meaning attached to it. We can use it as a multiplication operator, a repetition operator, for unpacking the iterables, and as a function *args. A single asterisk, as used in a function declaration, allows a variable number of arguments to be ... Read More

Updating Lists in Python

Gireesha Devara

Gireesha Devara

Updated on 14-Apr-2025 16:24:29

51K+ Views

In Python, lists are one of the built-in data structures that are used to store collections of data. The lists are mutable, which means we can modify its element after it is created. You can update single or multiple list elements using append, insert, extend, remove, and clear to ... Read More

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

Gireesha Devara

Gireesha Devara

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

6K+ 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 Double Star operator mean in Python?

Gireesha Devara

Gireesha Devara

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

10K+ 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

3K+ 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

1K+ 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

286 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

2K+ 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

283 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

268 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

Advertisements