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 …
-
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 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 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 article we show how to count positive and negative elements in a list We will show 2 metjods of doing this Example 1 Method 1 uses a for …
-
In this article we show 2 ways of replacing characters in a string using python Example 1 This first example lets the user enter a test string, a character to …
-
In this article, we will show you how to add two lists in python. There are a few ways to add two lists of elements in python. We will show …