Available tutorials in python

How to check whether a variable exists in Python

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

How to repeat a string in Python

In this tutorial, we are going to learn about how to repeat a string 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…

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 the last character from a string in Python

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

Removing the whitespace at the end of a string in Python

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

Removing the last character from a string in Python

Learn, how to remove the last character from a string in Python. We…

Removing the leading whitespace from a string in Python

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

How to check if a string starts with another in Python

Python has a built-in method by using that we can check if a given…

Removing the first character from a string in Python

Learn, how to remove the first character from a string in Python. We…

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 leading and trailing spaces in Python

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

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 convert datetime.timedelta to string in Python

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

How to print a Map object in Python

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

How to convert the String to a Float in Python

In python, we have a built-in function by using that we can convert a…

How to get a substring of string in Python

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

Python split multiline string to multiple lines

We can use the method to split the multiline string into a list of…

How to join list of items as a string in Python

To join the list of items of a different types as a string, we can use…

How to check if a Python string is Empty

To check if a python string is empty, we can use the statement…

How to trim whitespaces of a string in Python

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

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…

How to sort a list of numbers in Python

This example will show you how to sort a list of numbers in python by…

How to extract a substring in a String Python

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

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 remove a character from a Python String

Strings are immutable in python so that we can use the method which…

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 get the index of a character in Python String

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

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 get function name as a string in Python

In python, every function has an underscore property by using that we…

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…

Converting string to dictionary in Python

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

Removing empty strings from a Python list

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

How to convert a string to boolean in Python

To convert a string to boolean, we can use double equals operator in…

How to convert a String to Bytes in Python

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

How to get a filename without a extension in Python

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

Counting number of occurrences of a character in a Python String

To count the number of occurrences of a character in a string, we can…

How to convert an integer to a string in Python

To convert an integer to a string, we can use the built-in function…

How to create a multi-line string in Python

We can use triple quotes to create a multi-line string in python…

How to convert a string to an integer in Python

To convert a string to an integer we can use the built-in function in…

How to capitalize the first letter of every word in string Python

To capitalize the first letter of every word in a string, we can use…

How to add leading zeros to a Python String

To add leading zeros to a python string, we can use the method. Here…

How to lowercase a string in Python

To lowercase a string in python, we can use the method. Here is an…

How to uppercase a string in Python

To uppercase a string in python, we can use the method. Here is an…

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 reverse a string in Python

To reverse a string in python, we can use the slice syntax by passing…

How to print hello world in Python

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

Calling an external command from Python

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

How to run multiple commands in Python

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