Niharikaa Aitam has Published 93 Articles

How to touch all the files recursively using Python?

Niharikaa Aitam

Niharikaa Aitam

Updated on 01-Sep-2025 14:42:01

925 Views

In file system management, it's sometimes necessary to update the modification or access time of files which is commonly referred as "touching" files. This is useful in automation scripts, build systems or cache invalidation mechanisms. Python offers powerful modules such as os and pathlib to touch all files within a ... Read More

Program to find length of longest distinct sublist in Python

Niharikaa Aitam

Niharikaa Aitam

Updated on 01-Sep-2025 12:00:56

409 Views

A distinct sublist is a continuous portion of a list in which all the elements are different from each other. The goal is to find the maximum length of such a sublist within a given list of elements. In Python, a list is an ordered and mutable data structure ... Read More

Program to find length of longest consecutive sequence in Python

Niharikaa Aitam

Niharikaa Aitam

Updated on 01-Sep-2025 12:00:33

863 Views

A Consecutive sequence is a series of numbers where each number follows the previous one without any missing the order like 1, 2, 3, 4. It is a set of numbers where each number appears in increasing order by 1, even if not adjacent. We can find the Consecutive sequences ... Read More

Program to find length of longest anagram subsequence in Python

Niharikaa Aitam

Niharikaa Aitam

Updated on 01-Sep-2025 11:59:28

349 Views

In Python, a string is immutable data structure in which sequence of characters are enclosed in double("") or single quotes(''). In some cases, we need to find the length of the longest subsequence of characters that can be rearranged to form a palindrome. This type of subsequence is referred to ... Read More

Program to return number of smaller elements at right of the given list in Python

Niharikaa Aitam

Niharikaa Aitam

Updated on 01-Sep-2025 11:58:58

398 Views

In Python, a list is a ordered and mutable data structure where elements are enclosed in square braces []. In some scenarios, we may need to count how many elements to the right of each element in the list are smaller than it. Using Binary Search with bisect_left() Function The ... Read More

Program to find which element occurs exactly once in Python

Niharikaa Aitam

Niharikaa Aitam

Updated on 01-Sep-2025 11:58:21

446 Views

In Python, datastructures such as string, list etc., may contain duplicates of a value. In few scenarios, we may need to find which element appears only once while all others elements appear multiple times. Let's go through different methods to find which element occurs exactly once in Python. Using Bitwise ... Read More

Program to find longest equivalent sublist after K increments in Python

Niharikaa Aitam

Niharikaa Aitam

Updated on 30-Jun-2025 16:52:55

210 Views

The longest equivalent sublist after K increments is known as the longest contiguous portion of a list where we can make all the elements equal by performing at most K increment operations. Suppose we have a list of numbers called nums and k. Now, consider an operation where we can ... Read More

How to copy files from one server to another using Python?

Niharikaa Aitam

Niharikaa Aitam

Updated on 20-Jun-2025 19:31:03

9K+ Views

Transferring files from one server to another is a most common task in system administration, DevOps and development workflows. The tools such as scp and rsync are used for the file transfer. Python provides different methods and tools to transfer the files from one server to another using a third ... Read More

Check if both halves of the string have same set of characters in Python

Niharikaa Aitam

Niharikaa Aitam

Updated on 20-Jun-2025 19:29:52

310 Views

In Python, a string is one of the data structures that is a sequence of characters enclosed within single quotes '' or double quotes "". It is immutable, i.e., once a string is created, it cannot be changed. When we want to check if both halves of the string have ... Read More

Basic calculator program using Python program

Niharikaa Aitam

Niharikaa Aitam

Updated on 20-Jun-2025 19:27:44

1K+ Views

In this tutorial, we are going to build a basic calculator in Python. As we all know that a calculator will give six options to the user from which they select one option and we will perform the respective operation. Following are the arithmetic operations that we can perform using ... Read More

1 2 3 4 5 ... 10 Next
Advertisements