In this example we use the min and max functions which will return the smallest and largest items ina tuple Example # Largest and Smallest Item in a tuple number_tuple …
maxguy71
-
In this example we check to see if an item exists in a tuple We use the in operator to find the item that exists in a tuple. Example number_tuple …
-
In this example we show you how to create a tuple in python A tuple can have items of different data types like integers, floats, lists, strings, etc; Example There …
-
In this example we will show you how to check if a file exists using python This checks whether a file exists or not using the exists() function of the …
-
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 …
-
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 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 example we will list all the files in a specific directory that have a certain file extension This example shows how to find files in a directory with …
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 …