Latest Posts From Safa Mulani

Python zip() Function

Python zip() function stores data inside it. This function accepts iterable elements as input and returns an iterable as the output. If no iterable elements are provided to the python zip function, it returns an empty iterator. It thus aggregates elements from the iterables and returns iterables of tuples. Python Zip() Function Syntax: Python zip() […]

Python Reverse List

Python provides multiple ways to reverse the elements in a list. Python Reverse List Elements The following techniques can be used to reverse a Python List: By using the reversed() function By using the reverse() function By using Slicing technique By using for loop and range() function 1. reversed() function The reversed() method creates a […]

Python File Handling

What is Python File Handling? File handling is basically the management of the files on a file system. Every operating system has its own way to store files. Python File handling is useful to work with files in our programs. We don’t have to worry about the underlying operating system and its file system rules […]

Python import Statement

Python import statement enables the user to import particular modules in the corresponding program. It resembles the #include header_file in C/C++. As soon as the interpreter encounters the import statement in a particular code, it searches for the same in the local scope and imports the module, if present in the search path. It searches […]

Python Namedtuple

A sequence of immutable objects is a Tuple. Namedtuple enables the user to provide names to the elements in the Tuple. So, it provides the user with the option to access the elements either by index or by the designated name. Thus, it increases the readability of the code. Syntax: typename: It depicts the name […]

Python OrderedDict

OrderedDict is a subclass of the dictionary, which maintains the order in which the elements/items are added to it. OrderedDict preserves the order of insertion of the elements. A default dict does not save the order and results in the iteration in an arbitrary order. Initially, we need to import the collections module to use the […]