Category: python simple programs
Python | enumerate() on String | Get index and element
Output: <–Index–> VS <–Element–> 0 a 1 S 2 t 3 r 4 i 5 n 6 g
Python | Convert a String to list using list() method
Output: [‘a’, ‘S’, ‘t’, ‘r’, ‘i’, ‘n’, ‘g’]
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….
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…
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…
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…
Shift Numbers in Python | Assignment Expert
Shift numbers in Python mean we need to perform bitwise shift operations on numbers. There are two types of shift possible, bitwise left shift and…
Sum of n numbers in Python using for loop
Here, in the sum of n numbers in Python using for loop, n means a natural number i.e. counting numbers(1, 2, 3, 4, 5,…). Code…
Calculator Program in Python | On Different IDEs
Welcome to violet-cat-415996.hostingersite.com. In this tutorial, we are going to write a simple Calculator Program in Python and run it on different IDEs of python…
Miles Per Gallon Python Program
This is a simple Miles Per Gallon Python Program to calculate how many miles you drive in 1 gallon of oil. A gallon is a unit of volume in imperial units and