Posted in allcategorites programs in python python simple programs

Retrieve a module path in Python: 5 Methods

Now, you can use this ‘a_module’ inside your program but do you know where Python looks for modules or retrieve a module path? Let’s check….

Continue Reading
Posted in allcategorites programs in python python simple programs

Slicing in Python: 4 Important Things to Remember

This blog will discuss the principle of slicing in Python. Python has become one of the most popular languages in 2022 with the most job…

Continue Reading
Posted in allcategorites programs in python

How to get a function name as a string in Python?

Today, we will see the two most used methods to get a function name as a string in Python. Using __name__ to get a function…

Continue Reading
Access dictionary values in Python | dict[key] vs dict.get(key)
Posted in allcategorites programs in python python simple programs python-short-tutorial

Access dictionary values in Python | dict[key] vs dict.get(key)

dict[key] and dict.get(key) are two ways to access dictionary values in Python. The difference is that dict.get(key) takes two arguments while dict[key] takes one argument…

Continue Reading
Posted in allcategorites programs in python

Ternary operator in Python: 6 possible methods

There are many ways to make a ternary operator in Python but there exists a one-liner if-else statement that is usually called the ternary or…

Continue Reading
Posted in allcategorites programs in python

Get the length of a list in Python

Lists in Python are one of the most commonly used built-in data structures. Many times we need to find the length of a list in…

Continue Reading
Posted in allcategorites programs in python python simple programs

Factorial Program in Python: Top 6 Methods

What is factorial? The factorial of a number(non-negative integers) is the product of all positive numbers that are less than or equal to the number…

Continue Reading