The program should output all of the integers, one per line, with no blank lines between each line. This program should also output the largest random number that was on file.
myfile = open('mynumbers.txt', 'r')
lines = myfile.readline()
print(lines)
I have gotten that far and I'm stuck. I have literally been sitting here for 6 hours and I don't know what the deal is!
I need help using a loop to read and process the mynumbers.txt
file and then it also has to display the largest number that was in the group.
myfile = open('mynumbers.txt', 'w')
import random
num = random.randint(6, 12)
print(num)
for num in range(num):
myfile.write(str(random.randrange(10, 20)))
I also keep getting this error after I try everything.
ValueError: invalid literal for int() with base 10: '16 19 11 18 14 11 15 18 18 16 20 16'
Sorry everyone i'm new to the site!