Available tutorials in python

How to print hello world in Python

This simple example help you to print in python. You can also print…

How to read a file line by line into a list in Python

Here is an example that reads a file line by line and stores it into…

How to remove duplicate values from a Python List

To remove the duplicate values from a python list first, we need to…

How to lowercase the string in Python

In this tutorial, we are going to learn how to lowercase the given…

How to create a multi-line string in Python

In this tutorial, we are going to learn about how to create a multi…

How to get a filename without a extension in Python

We can get a filename without an extension by using the method in…

How to convert a String to Bytes in Python

To convert a string to bytes we can use the function in python. Here…

Removing empty strings from a Python list

To remove the empty strings from a list, we can use the built-in…

Converting string to dictionary in Python

To convert a string to dictionary, we can use the built-in method in…

How to concatenate a list of strings in Python

In python, we can use the method to concatenate a list of strings…

How to iterate through a String in Python

To iterate over a each character in a string we can use loop in…

How to convert bytes to a string in Python

To convert bytes to a string you need to use the method by passing…

How to remove the character of a string in Python

In this tutorial, we are going to learn about how to remove the…

How to extract a substring in a String Python

To extract a substring in python we can use the slicing syntax by…

How to trim whitespaces of a string in Python

We can remove the leading and trailing whitespaces of a string by…

How to split multiline string to multiple lines in Python

In this tutorial, we are going to learn about how to split the…

How to convert datetime.timedelta to string in Python

This following example shows you, how to convert a datetime.timedelta…

How to convert list to comma-separated string in Python

Python has a built-in String method by using that we can convert a…

How to remove multiple spaces from a string in Python

We can remove multiple spaces from a string with a single space by…

How to remove the first character of a string in Python

In this tutorial, we are going to learn about how to remove the first…

Removing the whitespace at the end of a string in Python

Learn, how to remove the (trailing) whitespace at the end of a string…

How to remove the last character of a string in Python

In this tutorial, we are going to learn about how to remove the last…

Removing the first and last character from a string in Python

Learn, how to remove the first and last character from a given string…

How to get first n elements of a list in Python

In this tutorial, we are going to learn about how to get the first n…

How to get the position of a character inside a string in Python

In this tutorial, we are going to learn about how to get the position…

How to get first n characters of a string in Python

In this tutorial, we are going to learn about how to get the first n…

How to make copy of a string in Python

In this tutorial, we are going to learn about multiple ways to copy a…

How to convert all strings in a list to ints in Python

In this tutorial, we are going to learn about how to convert all…

How to remove decimal part from a number in Python

In this tutorial, we are going to learn about how to remove the…

Counting number of occurrences of a character in a Python String

In this tutorial, we will learn how to count the number of occurrences…

How to create Multiline comments in Python

In this tutorial, we are going to learn about how to create a…

How to print literal curly-brace characters in python string and use .format

You need to wrap it with double curly braces to print the literal…

Remove the last element from a list in Python

In this tutorial, we are going to learn about how to remove the last…

How to clear a list in Python

In this tutorial, we are going to learn about how to clear or empty a…

How to uppercase the string in Python

In this tutorial, we are going to learn how to uppercase the given…

How to reverse a string in Python

Learn, how to reverse a string in Python. To reverse a string in…

How to reverse a list in Python

In this tutorial, we will learn about how to reverse a list in Python…

Python - How to comment a block of code

In this tutorial, we are going to learn about how to comment a block…

How to uppercase the first letter of a string in Python

In this tutorial, we are going to learn about how to uppercase the…

Python - unsupported operand type(s) for +:'int' and 'str'

In this tutorial, we are going to learn about how to solve the…

Removing the last n characters of a string in Python

In this tutorial, we are going to learn about how to remove the last n…

How to concatenate two strings in Python

In this tutorial, we are going to learn how to concatenate the two…

Capitalize the first letter of each word in a String in Python

In this tutorial, we are going to learn about how to capitalize or…

How to convert a list of strings to Integers in Python

To convert a list of strings into integers, we can use the function…

How to check if an list is empty in Python

In this tutorial, we are going to learn about how to check if an list…

How to append a string with other in Python

In this tutorial, we are going to learn about two different ways to…

How to add elements at the beginning of a list in Python

In this tutorial, we are going to learn about two different ways to…

Convert the String to a Float in Python

In this tutorial, we are going to learn about how to convert the…

How to get function name as a string in Python

In this tutorial, we are going to learn about how to get the function…

How to convert the float to Int in Python

In this tutorial, we will learn about how to convert the float to an…

How to check if a number is multiple of 10 in Python

In this tutorial, we are going to learn about how to check if a given…

Checking if a number is divisible by another number in Python

In this tutorial, we are going to learn about how to check if a number…

How to check if multiple variables are not None in Python

In this tutorial, we are going to learn about how to check if a…

How to check if a variable is None in Python

In this tutorial, we are going to learn about how to check if a…

How to write a string to a text file in Python

To write a string to text file, we can use the method in python. Here…

How to declare variable without any value in Python

In this tutorial, we are going to learn about how to declare a…

How to check if a string is a number in Python

In this tutorial, we are going to learn about how to check if a given…

How to get last n characters of a string in Python

In this tutorial, we are going to learn about how to get the last n…

How to get the OS name in Python

In this tutorial, we will learn how to get the current OS (operating…

How to get last 4 characters of a string in Python

In this tutorial, we are going to learn about how to get the last…

How to check if a variable is list in Python

In this tutorial, we are going to learn about how to check if a…

How to check if a variable is tuple in Python

In this tutorial, we are going to learn about how to check if a…

Check if a variable is divisible by 2 in JavaScript

In this tutorial, we are going to learn about how to check if a given…

Check if a variable is a string or not in Python

In this tutorial, we are going to learn about how to check if a…

Getting the length of a list in Python

In this tutorial, we are going to learn about how to get the length of…

Check if multiple variables have same value in Python

In this tutorial, we are going to learn about how to check if a…

Checking if variable is a integer in Python

In this tutorial, we are going to learn about how to check if the…

How to print a Map object in Python

If you try to print a map object in python, you’ll see the following…

Convert the string to Double in Python

In this tutorial, we are going to learn about how to convert the…

Fixed - dict object is not callable error in Python

In this tutorial, we are going to learn how to fix the TypeError…

How to check if a string starts with a number in Python

In this tutorial, we are going to learn about how to check if a string…

Initialize an empty list with certain size in Python

In this tutorial, we are going to learn about how to intialize or…

How to initialize an empty string in Python

In this tutorial, we are going to learn about how to intialize or…

How to check whether a variable exists in Python

Learn, how to check whether a variable exists or not in Python…

Python - can only concatenate str (not float) to str

In this tutorial, we are going to learn about how to solve the…

Concatenate two strings with space in Python

In this tutorial, we are going to learn how to concatenate the two…

How to solve list object is not callable error in Python

In this tutorial, we will learn how to solve the TypeError: ‘list…

Fix the 'str' object is not callable error in Python

In this tutorial, we are going to learn how to fix the TypeError: ‘str…

Fix the 'int' object is not callable error in Python

In this tutorial, we are going to learn about how to fix the TypeError…

Python - Can only concatenate str (not int) to str

In this tutorial, we are going to learn about how to solve the…

Python - How to solve 'int' object is not iterable

In this tutorial, we are going to learn about how to solve the…

Solve - float object is not callable error in Python

In this tutorial, we are going to learn about how to solve the…

Getting the first element of a List in Python

In this tutorial, we are going to learn about how to get the first…

Python - ImportError: No module named six

In this tutorial we are going to learn about, how to fix the…

Solve - (unicode error) codec can't decode bytes in position 2-3: truncated UXXXXXXXX escape

In this tutorial, we are going to learn about how to solve the…

Python - ModuleNotFoundError: No module named 'six' [Solved]

In this tutorial we are going to learn about, how to fix the…

How to reverse a tuple in Python (2 Easy ways)

In this tutorial, we are going to learn about, how to reverse the…

Check the last digit of a number in Python

In this tutorial, we are going to learn about how to check the last…

Python - Get the first digit of a number

In this tutorial, we are going to learn about how to get the first…

Get the first two digits of a number in Python

In this tutorial, we are going to learn about how to get the first two…

Python - Get the last digit of a number

In this tutorial, we are going to learn about how to get the last…

Get last 2 digits of a number in Python

In this tutorial, we are going to learn about how to get the last…

Get last 3 digits of a number in Python

In this tutorial, we are going to learn about how to get the last…

Get the first 2 characters of a string in Python

In this tutorial, we are going to learn about how to get the first…

How to get length of a string in Python

In this tutorial, we will learn how to get the length of a string in…

How to get last element of a list in Python

In this tutorial, we are going to learn about how to get the last…

How to append multiple values to a list in Python

In this tutorial, we are going to learn about how to add a multiple…

Removing the first n characters of a string in Python

In this tutorial, we are going to learn about how to remove the first…

How to convert a string to an integer in Python

In this tutorial, we are going to learn how to convert the string to…

Remove the first element from a list in Python

In this tutorial, we are going to learn about how to remove the first…

How to run multiple commands in Python

This example will show you, how to run a multiple bash commands with…

How to get last n elements of a list in Python

In this tutorial, we are going to learn about how to get the last n…

How to get the first character from a string in Python

To get the first character from a string, we can use the slice…

How to get the last character of a string in Python

To get the last character of a string, we can use the slice notation…

How to repeat a string n times in Python

In this tutorial, we are going to learn about how to repeat a string n…

Calling an external command from Python

This example will show you how to call an external command from Unix…

Concatenating the two lists in Python

In this tutorial, we are going to learn how to concatenate the two…

How to add leading zeros to a Python String

Learn, how to add leading zeros in a string in Python with the help of…

How to get the index of a character in Python String

To get the index of a character in a python string, we can use the…

Convert integer to a string in Python

In this tutorial, we are going to learn about how to convert the…

How to convert a string to boolean in Python

In this tutorial, we are going to learn about how to convert the…

How to get a current year in Python

In this tutorial, we are going to learn about how to get the current…

How to check if a string ends with another in Python

In this tutorial, we are going to learn about how to check if a string…

How to add a elements at the end of a list in Python

In this tutorial, we are going to learn about two different ways to…

How to sort a list of numbers in Python

In this tutorial, we are going to learn about how to sort the list of…

How to initialize an empty list in Python

In this tutorial, we are going to learn about how to intialize or…

How to get a substring of string in Python

To get a substring of a string, we can use the slice syntax in python…

How to join the list of elements to string in Python

In this tutorial, we are going to learn about how to join the list of…

How to check if a string starts with another in Python

In this tutorial, we are going to learn about how to check if a string…

How to Convert the char to a int in Python

In this tutorial, we are going to learn about how to convert the char…

How to Convert the integer to character in Python

In this tutorial, we are going to learn about how to convert the…

How to check if a Python string is Empty

In this tutorial we are going to learn about, how to check if a string…

How to remove the leading and trailing spaces in Python

To remove the leading and trailing white spaces from a string, we can…

Removing the leading whitespace from a string in Python

Learn, how to remove the leading whitespace of a string beginning in…

How to convert a boolean into string in Python

In this tutorial, we are going to learn about how to convert the…

How to get the previous month name in Python

In this tutorial, we are going to learn about how to get the previous…

How to get a previous year in Python

In this tutorial, we are going to learn about how to get the previous…