Safa Mulani

An enthusiast in every forthcoming wonders!

Python Collections

A Collection is used to represent a set of similar data items as a single unit that is used to group and manage related objects. They contain data structures that are used to manipulate and store data efficiently. Python collections module provides a lot of data structures to implement different types of collections. The following […]

Python Collections Read More »

Python Not Equal operator

A comparison operator identifies the relationship between the operands and results into True or False. One such basic yet important operator is not equal operator in Python. It returns True if the values on either side of the operator are unequal i.e. it returns True when two variables of same type have different values, else

Python Not Equal operator Read More »

Python sys Module

Python sys module deals with the system and environment-specific variables and parameters. We can use it to read the PATH variable and the list of command-line parameters passed to the Python script. Import sys Module in Python Before using any module, it needs to be imported. Syntax: import module_name Example: import sys Python sys.modules This

Python sys Module Read More »

Python AND Operator

Operators are basically used to perform operations on the data to be manipulated. There are various kinds of operators i.e. Logical Operators, Bitwise Operators, Arithmetic Operators, etc. There are two kinds of AND Operators in Python: Logical AND Operator Bitwise AND Operator Logical AND Operator Logical AND operator work with boolean values and results into

Python AND Operator Read More »

Introduction to Python Modules

Modules are the pre-defined files that contain the python codes which depict the basic functionalities of class, methods, variables, etc. It consists of different functions, classes in a group of files inside a directory. Modules can also be termed as Libraries. These are basically the pre-defined methods that can be used to make the code

Introduction to Python Modules Read More »

String Comparison in Python

The following are the ways to compare two string in Python: By using == (equal to) operator By using != (not equal to) operator By using sorted() method By using is operator By using Comparison operators 1. Comparing two strings using == (equal to) operator Output: Enter the first String: AA Enter the second String:

String Comparison in Python Read More »

Python Reverse String

Strings are basically sequence of characters. Python doesn’t support in-built string functions such as reverse() to reverse a string. The following are the ways to reverse a string in Python: By using a for loop By using a while loop By using a Slicing By using join() method By using Recursion By using List reverse()

Python Reverse String Read More »

String Concatenation in Python

Concatenation is a method of joining strings together to form a new string altogether. The following are the methods to perform String Concatenation in Python: By using + operator By using join() method By using % operator By using format() function By Literal String Interpolation By using StringIO from IO Module By using += concatenate

String Concatenation in Python Read More »