Python String Functions

Python has built-in functions for almost every operation that is to be performed on a string. To make it simple, these are classified on the basis of the frequency of their use as well as their operations. They are as follows : Python String Functions Classification Basic Functions Advanced Functions Miscellaneous (These functions are not …

Python String Functions 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 »

How to Sort Array in Python

Python arrays can be sorted using different sorting algorithms, varying in their runtime and efficiency based on the algorithm chosen. We investigate some of these approaches towards sorting array elements. Using sorted() on Python iterable objects Python uses some extremely efficient algorithms for performing sorting. The sorted() method, for example, uses an algorithm called Timsort …

How to Sort Array in Python Read More »

Python String capitalize() Function

String in Python has built-in functions for almost every action to be performed on a string. Python String capitalize() function is used to convert only the first character to the uppercase letter, rest all characters are lowercase. Key Points : Return Type: String Parametric Values: No parameters can be parsed onto capitalize() function. Converts only …

Python String capitalize() Function Read More »

Polymorphism in Python

Polymorphism means having vivid or different forms. In the programming world, Polymorphism refers to the ability of the function with the same name to carry different functionality altogether. It creates a structure that can use many forms of objects. This permits functions/arguments to use entities of different types at different times. In object-oriented programming, Polymorphism …

Polymorphism in Python Read More »

Operator Overloading in Python

Operator Overloading is the phenomenon of giving alternate/different meaning to an action performed by an operator beyond their predefined operational function. Operator overloading is also called Operator Ad-hoc Polymorphism. Python operators work for built-in classes. But the same operator expresses differently with different types. For example, The + operator will perform arithmetic addition on two numbers, …

Operator Overloading in Python Read More »

Python Bitwise Operators

Operators are used to performing operations on values and variables. These symbols carry out all kinds of computations. The value on which the operator operates on is known as Operand. In Python, bit-wise operators are used to performing calculations on integers according to the bits. The integers are converted into binary and then bit by bit …

Python Bitwise Operators Read More »