In this article we show a way of sorting a list in descending order in python Example We use a for loop to add numbers to the Python list using …
Exercises
-
In this article we show how to sort a list in ascending order in python Example We use a for loop to add numbers to the Python list using the …
-
In this example we check if a string is a palindrome in python A palindrome is a string that is the same read forward or backward. Example // check if …
-
In this example we will find all files with a certain extension in a directory using python We have 2 examples on how to do this. Example 1 We use …
-
In this example, you will learn to check the file size in python. We will show 2 different ways to do this Example 1 Using stat() from the os module, you can get the …
-
In this example we look at how you can get the difference between two dates in days. There are a couple of ways of doing this but by far the …
-
In this article we will show you how to find yesterdays date, todays date and tomorrow’s date, the current time is determined, and a method is used that helps find …
In this example we will show how to get the line count of a file Example The test file contains the following, notice the blank lines this is line 1 …
A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam, dad, mum and toot. There are also numeric …