In this example we will open a csv file using the csv module The contents of our test csv file called Countries2.csv was Entry,Country,Capital 1,France,Paris 2,Germany,Berlin 3,Spain,Madrid 4,Italy,Rome 5,UK,London Example …
maxguy71
-
In this example we will show you how to add or subtract days to a date in Python Example The timedelta() method takes the number of days to be added …
-
In this example we show how to get a random element from a list using python We will use 3 different methods to do this random.randint(start, stop) – start and …
-
In this example we check if a number is a perfect number using python In number theory, a perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the …
-
In this example we will show you how to work out the factorial of a number in python The factorial of a non negative number is the product of all …
-
In this article we show how to remove punctuation marks from a string in python There are 14 punctuation marks that are used in the English language. They are: the …
-
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 …
In this example we show 3 ways of checking if a list is empty in python Example If my_list1 is empty then not returns True len of my_list2 – If …
In this article we count the occurrences of letters, digits and special characters in a string using python Example We use isalpha() to check if all the characters in the …