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 …
maxguy71
-
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 …
-
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 …
-
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 …
-
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 look at two ways of showing the difference between two dates in months Example 1 from datetime import datetime startdate = datetime(2018, 6, 2) enddate …
-
In this article we show how to count odd and even elements in a list We will show 2 methods of doing this Example 1 Method 1 uses a for …
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 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 …