Answer :

# open the file in read mode

with open("numbers.txt", "r") as f:

   # create a StreamReader object

   reader = f.readlines()

   

   # get the 5000th number in the file

   5000th_number = reader[4999]

   

   # find the largest number in the file

   largest_number = max(reader)

   

# print the results

print("The 5000th number in the file is:", 5000th_number)

print("The largest number in the file is:", largest_number)

Other Questions