Niharikaa Aitam has Published 93 Articles

How to count elements in a nested Python dictionary?

Niharikaa Aitam

Niharikaa Aitam

Updated on 10-Jun-2025 17:44:49

18K+ Views

A Nested dictionary is a dictionary inside another dictionary. In Python, we have the function len() to count elements in a Nested Dictionary. With that, we can also use a function that recursively calls and calculates the elements in an arbitrary depth of the nested dictionary. Non-Recursive Count in Nested ... Read More

What is the maximum file size we can open using Python?

Niharikaa Aitam

Niharikaa Aitam

Updated on 10-Jun-2025 17:34:51

3K+ Views

In Python, there is no fixed maximum file size that we can open. Python can open files of any size as long as the operating system and file system support until there is enough memory and disk space available. The limit of maximum file size comes with the system architecture, ... Read More

How we can use Python Tuple within a Tuple?

Niharikaa Aitam

Niharikaa Aitam

Updated on 10-Jun-2025 17:22:30

10K+ Views

In Python, a Tuple is an ordered and immutable collection of elements, and tuples are created using parentheses. In this article, we are going to explore all the different ways to use a tuple within a tuple. Tuple within a Tuple in Python A tuple can contain elements of any ... Read More

How do I do a case-insensitive string comparison in Python?

Niharikaa Aitam

Niharikaa Aitam

Updated on 10-Jun-2025 16:37:19

4K+ Views

In Python, string comparisons are case-sensitive by default. For example, when we consider the strings "Hello" and "hello" then they are considered as two different strings because of the difference in their letter casing.  Case-insensitive String Comparison in Python In some tasks, such as searching user input, comparing filenames, ... Read More

How to match a non-whitespace character in Python using Regular Expression?

Niharikaa Aitam

Niharikaa Aitam

Updated on 09-Jun-2025 09:55:51

4K+ Views

A non-whitespace character is any character that is not a space, tab i.e., \t, newline i.e., or carriage return \r. Examples of non-whitespace characters such as letters, digits, punctuation and special symbols. In Python, Regular Expressions (RegEx) are used to match the patterns in the given input strings. The re ... Read More

What is the difference between Python\\'s re.search and re.match?

Niharikaa Aitam

Niharikaa Aitam

Updated on 09-Jun-2025 09:47:04

2K+ Views

In Python, Regular expressions are also called RegEx, which is a sequence of characters that defines a search pattern. The re module provides several functions to work with patterns in text. This is widely used in Python tasks such as string matching, validation, and manipulation. The most commonly used functions ... Read More

How to update a Python dictionary values?

Niharikaa Aitam

Niharikaa Aitam

Updated on 09-Jun-2025 09:34:02

73K+ Views

In Python, a Dictionary is one of the data structures that contains key-value pairs enclosed in curly braces '{}'. It is a Mutable and ordered data structure. Before proceeding with updating the values of a dictionary, let's create an example Dictionary with 4 key-value pairs, in which Product, Model, Units, are ... Read More

How to get the maximum file name length limit using Python?

Niharikaa Aitam

Niharikaa Aitam

Updated on 08-Jun-2025 12:56:40

3K+ Views

In Python, when performing file operations such as creating or renaming files, one of the limitations is the maximum length limit of a file name, and when we exceed this limit, then results in errors such as OSError: [Errno 36] File name too long. Using os.pathconf() function In Python, the os.pathconf() ... Read More

How to match a word in python using Regular Expression?

Niharikaa Aitam

Niharikaa Aitam

Updated on 08-Jun-2025 12:44:29

5K+ Views

In Python, Regular Expressions (RegEx) are used to match patterns in the given input strings. The re module in Python provides different methods to use the regular expressions. This module helps the developers to perform search operations, validations, filtering, and much more based on string patterns. In this article, we ... Read More

How can I match the start and end in Python\\\'s regex?

Niharikaa Aitam

Niharikaa Aitam

Updated on 08-Jun-2025 11:22:07

2K+ Views

In Python, the re module is used to work with regular expressions. In some cases, we need to check whether a string starts or ends with a specific pattern, and then we need to use special regex characters called anchors. Following are the anchors used in regular expressions - ... Read More

Advertisements