Category Archives: Python

Python Max

Python has many built-in functions that can perform specific tasks. max() is one of the widely used python functions which returns the largest item from an iterable object. Generally, max() return the largest element according to the lexicographical order, but it can also be customized using the key keyword. Example print(max(1,2,3,4,5)) Output 5 max() function parameters We can… Read More »

Python Reverse List

A python list can contain multiple items, and each piece is mapped using index values. The index value of the python list starts from 0 up to n-1 (n is the total number of elements present in the list). Reverse a Python list There are primarily four techniques we can use to reverse a python list. use list reverse() method.… Read More »

Python Strip

In python, the string data type has a strip() method which is capable of removing the initial and ending space or characters from a string. By default, the strip() method remove the leading and trailing space from a string but it can also remove specified characters. strip() syntax # to remove space extra initial and ending spaces string.strip()… Read More »

Python String to int

In Python, integer numbers are represented as the whole numbers with no fraction value. In Python using the int and str data types we can store integer values however the arithmetic operators do not work on str datatype.  In this tutorial, we have provided the python code snippets which can convert Python str datatype to an int datatype.… Read More »

Python Lowercase

In Python, a string object has many built-in methods which can also help in manipulating the case of the string. The string .lower() method can convert all the uppercase characters of the string into a lower case and return the value. This method comes very useful when we want to check if two strings are the same despite… Read More »

Find the length of a List in Python

A Python list can contain heterogeneous elements in sequential order. Unlike other programming-languages Python does not support built-in array data structure, but the list provides an alternative for it. Using the list, we can also store duplicate items. In Python, we have an in-built function len()which calculates the total number of elements present in a list and return… Read More »

Null in Python

In other high-level programming languages such as Java, C and C++ we have the concept of null. There null is used to represent or point empty value or no value at all. But in Python, we do not have null instead we use the None keyword which is pretty similar to the concept of null. Python None keyword… Read More »