Yaswanth Varma has Published 377 Articles

Alternate Cycling in Python List

Yaswanth Varma

Yaswanth Varma

Updated on 14-Jul-2025 12:46:34

374 Views

Lists in Python are ordered collections that store and manipulate a sequence of elements. In this article, we are going to learn alternate cycling in Python. It is used when we need to work with the alternate element, instead of processing every element in the ... Read More

Concatenated string with uncommon characters in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 20-Jun-2025 16:37:14

935 Views

In Python, Strings are one of the commonly used data types that are used to store sequences of characters. In this article, we are going to learn to concatenate strings with uncommon characters in Python. The uncommon characters are the characters that appear in one string but not in ... Read More

Python program to iterate over multiple lists simultaneously?

Yaswanth Varma

Yaswanth Varma

Updated on 20-Jun-2025 16:23:35

336 Views

In this article, we are going to learn how to iterate over multiple lists simultaneously. It is useful when the lists contain related data. For example, one list stores names, another stores genders, and the last one stores ages. By iterating over these lists simultaneously, we can access the necessary ... Read More

Python program to find common elements in three sorted arrays?

Yaswanth Varma

Yaswanth Varma

Updated on 20-Jun-2025 12:52:42

759 Views

The given task is to find the common element in three sorted arrays. Input Output Scenario Following is an input-output scenario - Input Arrays: array1 = [1001, 1004, 1007, 1009, 1015, 1020] array2 = [1002, 1004, 1009, 1013, 1015, 1022] array3 = [1000, 1004, 1009, 1015, 1021] ... Read More

Python program to reverse bits of a positive integer number?

Yaswanth Varma

Yaswanth Varma

Updated on 19-Jun-2025 18:23:53

2K+ Views

In Python, every number is represented internally as a sequence of binary digits, known as bits. In this article, we are going to learn how to reverse the bits of a positive integer number. Reversing the bits of a Positive Integer Number If we reverse bits of an integer value, ... Read More

Python program to reverse an array in groups of given size?

Yaswanth Varma

Yaswanth Varma

Updated on 17-Jun-2025 17:38:21

630 Views

In Python, Arrays are commonly used to store and manage collections of data. In this article, we are going to learn how to reverse an array in groups of a given size. For example, let's consider the array and a number k, which represents the size of the array. ... Read More

Python program to cyclically rotate an array by one

Yaswanth Varma

Yaswanth Varma

Updated on 17-Jun-2025 17:37:34

2K+ Views

The cyclic rotation of an array involves moving every element of the array one position forward, and the last element gets moved to the first position. For example, if the given array is [1, 2, 3, 4] then the array after one cyclic rotation is [4, 1, 2, 3]. ... Read More

Python program to print a checkboard pattern of n*n using numpy.

Yaswanth Varma

Yaswanth Varma

Updated on 17-Jun-2025 17:37:02

600 Views

The checkboard pattern is the square grid composed of alternating 0s and 1s, arranged in a way that no two adjacent cells have the same value. It looks like the chessboard, where black and white squares alternate in every row and column. This kind of pattern is not only ... Read More

How to retrieve Python module path?

Yaswanth Varma

Yaswanth Varma

Updated on 17-Jun-2025 17:36:29

1K+ Views

In Python, every module exists in a specific file path within the file system. Sometimes, we need to find out where the module is located to perform different operations, like debugging or verifying the version of the module. In this article, we will explore how to retrieve the file path ... Read More

What is the difference between dir(), globals() and locals() functions in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 17-Jun-2025 17:36:01

743 Views

The Python built-in functions,  dir(), globals(), and locals are used to provide insights into the objects, variables, and identifiers present in various scopes. They might look similar, but each function serves a different purpose and behaves differently depending on where and how it is used. In this article, we ... Read More

Previous 1 ... 3 4 5 6 7 ... 38 Next
Advertisements