Nikitasha Shrivastava has Published 70 Articles

How to get a value for a given key from a Python dictionary?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 11-Jun-2025 12:47:53

34K+ Views

In this article, we will show you how to get a value for the given key from a dictionary in Python. Below are the 4 different methods to accomplish this task - Using Dictionary Indexing Using dict.get() Method Using keys() Function Using items() Function Assume we have taken ... Read More

How does the del operator work on a tuple in Python?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 11-Jun-2025 10:52:32

6K+ Views

A tuple is an ordered and immutable collection of Python objects separated by commas. Like lists, tuples are sequences. Tuples differ from lists in that they can not be modified, whereas lists can, and they use parentheses instead of square brackets. Though we can not change individual elements of a ... Read More

How does the repetition operator work on a tuple in Python?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 11-Jun-2025 10:45:32

6K+ Views

In Python, the "*" operator can be used to repeat a tuple multiple times. This is known as tuple repetition. It creates a new tuple with repeated elements but does not modify the original tuple. Following are some points to remember - The repetition operator (*) creates a new ... Read More

How does concatenation operator work on tuple in Python?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 11-Jun-2025 10:37:14

1K+ Views

The concatenation operator (+) is basically used to join two or more tuples together in Python. This operation returns a new tuple that contains all the items of the original tuples. In this article, we will discuss how the concatenation operator works on tuples in Python. But first, let us ... Read More

How does the \'in\' operator work on a tuple in Python?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 11-Jun-2025 10:30:36

3K+ Views

Python offers the 'in' operator to verify that a value is present in a tuple. This operator is very useful when you are looking for items in a collection without requiring loops or complex logic. In this article, we will discuss the 'in' operator and how it works on tuples ... Read More

Why do you think tuple is an immutable in Python?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 11-Jun-2025 10:19:17

5K+ Views

Tuples in Python are immutable, which means once we create them, we can not change their items. In this article, we will discuss why tuples are immutable before moving on, and we will understand tuples in detail. Tuples in Python Tuples are a data type that belongs to the sequence ... Read More

Decimal fixed point and floating point arithmetic in Python

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 10-Jun-2025 19:07:53

2K+ Views

This article will explain how decimal fixed-point and floating-point arithmetic work in Python, which is useful for performing accurate calculations in various applications. Numbers in Python can be stored in two ways: floating-point and decimal fixed-point. Floating-point numbers are fast but can sometimes be incorrect because of how computers store ... Read More

Python Functions creating iterators for efficient looping

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 10-Jun-2025 19:01:35

267 Views

In this article, we will talk about creating iterators for efficient looping in Python functions. An iterator is something that helps you go through all the items one by one, like going through pages of a book one page at a time. In Python, we can use lists, tuples, dictionaries, ... Read More

How to print complete TimeTuple in Python?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 06-Jun-2025 16:33:59

231 Views

In this article we will show you how you can print complete TimeTuple in Python. So printing a complete timeTuple in Python is very useful when you want to extract various parts of a date. For example you can use it to get the year, month, day, hour, minute, second ... Read More

What is a Tick in python?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 06-Jun-2025 16:31:07

2K+ Views

In Python, a tick is the floating-point number to show time in seconds since January 1, 1970. This is mainly used in time calculations and logging timestamps in programs. Python's time module givens the function time.time() to fetch the current tick value. It is very useful for measuring execution tracks ... Read More

Advertisements