Niharika Aitam has Published 172 Articles

How to create an empty tuple in Python?

Niharika Aitam

Niharika Aitam

Updated on 29-May-2025 11:36:02

9K+ Views

Tuple is one of the data structures of the Python programming language. It is used to store multiple values separated by commas in an ordered manner. It is immutable in the sense that once the tuple is created cannot perform any operations like deleting, appending, etc. The elements in the ... Read More

What are Getters/Setters methods for Python Class?

Niharika Aitam

Niharika Aitam

Updated on 29-May-2025 11:31:40

1K+ Views

Encapsulation is one of the fundamental concepts in object-oriented programming (OOP). It describes the idea of wrapping data and the methods that work on data within one unit. This restricts accessing variables and methods directly and can prevent the accidental modification of data. ... Read More

How I can dump a Python tuple in JSON format?

Niharika Aitam

Niharika Aitam

Updated on 29-May-2025 11:29:51

1K+ Views

JSON can be abbreviated as JavaScript Object Notation. It means a script of a text file in a programming language to transfer and store the data. It is supported by the Python programming language using a built-in package named JSON. Its text is given in the quoted string format, which ... Read More

How do we use double quotation in Python?

Niharika Aitam

Niharika Aitam

Updated on 29-May-2025 11:27:14

627 Views

Double Quotes in PythonDouble quotes are used to represent a string or a character. The functionality of the single quotes and double quotes is the same. We can use any type of quote as per our requirement. The following is the syntax to create a string using double quotes ... Read More

How to find out if a Python object is a string?

Niharika Aitam

Niharika Aitam

Updated on 29-May-2025 11:24:49

372 Views

The class is a blueprint, which is used as the reference to create the object. This contains attributes and methods in a logical entity.Let’s understand the usage of the class in an object-oriented programming language through a real-time scenario. ... Read More

What is usage of update method in Python dictionary?

Niharika Aitam

Niharika Aitam

Updated on 24-Apr-2025 19:03:31

496 Views

The update method is one of the methods of the dictionary data structure. It is used to update the values in the already created dictionary, which means it adds a new key-value pair to the dictionary. The updated key and value will be updated at the last. Python update() Method ... Read More

How to declare a multi dimensional dictionary in Python?

Niharika Aitam

Niharika Aitam

Updated on 17-Apr-2025 16:45:32

994 Views

Multidimensional Dictionaries in python Multidimensional dictionaries are part of the dictionaries in Python, which are used to store data. Created by assigning a dictionary to a key within another dictionary, these structures are represented by curly braces {} and can accommodate any data type. Their mutable nature allows modifications after ... Read More

How to serialize Python dictionary to XML?

Niharika Aitam

Niharika Aitam

Updated on 28-Feb-2025 19:25:35

207 Views

The XML is the markup language used to transfer the data. The XML syntax is the same as the HTML, whereas the tags are predefined in HTML and not in XML. This offers us to store the data between the opening and closing tags. In Python, dictionaries store data as ... Read More

What is operation of <> in Python?

Niharika Aitam

Niharika Aitam

Updated on 28-Feb-2025 18:42:23

128 Views

Understanding the Operator in Python The is one of the operators available in Python. The present version that we are using is Python 3. The previous version was Python 2. Some of the operators in Python 2 don't support in Python 3. is used in Python 2, ... Read More

Write a python program to count total bits in a number?

Niharika Aitam

Niharika Aitam

Updated on 28-Feb-2025 17:02:47

249 Views

Python Program to Count Total Bits in a Number To calculate the total bits in a number, convert it to binary using the bin() function. A bit represents data as 0 or 1, and 8 bits make a Byte. Bits are essential for data transmission, storage, and arithmetic operations, and ... Read More

1 2 3 4 5 ... 18 Next
Advertisements