python

python

Python example to print the function name as string with __name__ and __qualname__

Python program to get the function name as a string. We will learn how to use the __name__ and __qualname__ attributes to get the name of a function in this post with example.

Read
python

3 different Python programs to get a string after a substring

Python program to get a string after a specific substring. We will learn three different ways to get the string after a given substring of a string in Python.

Read
python

Python assert statement explanation with examples

Python assert statement explanation with examples. This post will explain to you what is assert statement and how it works in Python with examples.

Read
python

3 different Python programs to remove the first character of string

Python program to remove the first character of a string in 3 different ways. We will learn how to do it by using string slicing, split and with the replace method in Python.

Read
python

Python program to check if a number is a perfect number or not

Python program to check if a number is a perfect number or not with user input number. It will also find all perfect numbers in a given range.

Read
python

Python program to check for Moran numbers

Python program to check if a number is moran number or not. This post will also show you how to find all Moran numbers in a range with user input values.

Read
python

Difference between random.sample() vs random.choice() in Python

This post will explain the differences between random.sample() and random.choice() in Python. Both of these functions are defined in the random module and they are used to get a list or a single random element from a list.

Read
python

Python program to check if a number is a magic number or not

Learn how to check if a number is a magic number or not in Python. The program will check one single number and find out all magic numbers in a range.

Read
python

Python program to convert celsius to Fahrenheit and vice versa

Python program to convert a celsius value to Fahrenheit and Fahrenheit value to celsius. The program will take the value as input from the user and print the converted value.

Read
python

Python program to check if a number is duck number or not

Learn how to check if a number is a duck number or not. A number is called a duck number if the number contains at least one zero. We will learn two ways to check if a number is a duck number or not.

Read