python

5 different ways to print multiple values in Python

Python program to print multiple values. We will learn 5 different ways to print multiple values in python.

Read
python

Python program to convert millimeters to inches

Python program to convert millimeters to inches. The program will take the millimeters value as input from the user and convert it to inches.

Read
python

Python program to convert inches to millimeters

Python program to convert inches to millimeters. The program will take the inches as input from the user and convert it to millimeters and print that on console.

Read
python

Python program to check if a number is prime or not

How to check if a number is prime or not in python. A number is called prime if its factors are 1 and the number itself.

Read
python

Python program to check if a file exists

Python program to check if a file exists or not. We will use os.path.exists method and pathlib module to check that.

Read
python

Python program to replace all negative numbers with zero in a list

Python program to replace all negative numbers with zero in a list. We will learn how to do that by using a loop and using a recursive method.

Read
python

Split the root, extension of a path in Python using os.path.splitext

Python program to split the root and extension of a path by using os.path.splitext. Learn the definition of os.path.splitext with example.

Read
python

How to decrement a for loop in Python

Python program to decrement a for loop. Learn how to do this by using range() and by using reversed() methods.

Read
python

How to truncate datetime object and get the date in Python

Python program to truncate a datetime object and get the date from it. We will learn three ways - by using date(), using strftime and by reading the properties of datetime.

Read
python

How to create a new text file in python

Python program to create a new text file. Learn how to create a new text file by using x mode and w mode in Python

Read