python

python

Python raw strings : Explanation with examples

Python raw strings are used to treat backslash as a literal character. Using raw strings, we can print '\n', '\t' etc. as any other characters. In this post, we will learn what is python raw string with different examples.

Read
python

Convert an integer or float to hex in Python

Python program to convert an integer or float to hexadecimal. We can use the hex method or float.hex method to convert an int or float value to hex value.

Read
python

Python program to print a star hollow square pattern

In this tutorial program, we will learn how to print a hollow square pattern in Python. You will learn two different ways to print the pattern. We will also learn how to take the character as user input.

Read
python

Python program to find a substring in a string

How to find a substring in a string in Python. This post will show you how to use find to find a substring in Python programming language

Read
python

How to find the length of a string in python

We need to find the length of a string most of the time while development of any software. Either you are using python or any other language, finding the string length is one of the most commonly faced problems during software development.

Read
python

Python tutorial to check if a user is eligible for voting or not

In this python tutorial, we will learn how to check if a user is eligible for voting or not. The program will take the age as an input from the user, check the eligibility and then print out the result.

Read
python

Python program to replace single or multiple character,substring in a string

Python program to replace single or multiple characters or substrings in a string. Learn how to replace single or multiple character or substrings for single or n number of times.

Read
python

Python program to remove all occurrence of a value from a list

In this tutorial, we will learn how to remove all occurrence of a value from a list in python. For example, if the list is [1,1,2] and if we will remove all occurrence of 1, it will become [2]. I will show you two different ways to solve this problem. Let's take a look :.

Read
python

Python program to iterate over the list in reverse order

In this tutorial, we will learn how to iterate over a list in reverse order. For example, if we have a list [1,2,3,4,5], we will traverse it in the order 5->4->3->2->1. We have different ways to traverse a list in reverse order. This iteration will not change the order of the list and we will not do any modification to the list elements.

Read
python

Python issubclass function in details

Sometimes we need to quickly verify if a class is subclass of a different class or subclass of another tuple of classes of not. All classes in python are derived from a parent class known as ‘Object class’. If we derive a class from a different class, this new class is called a child class and the original class is called parent class or super class.

Read