Question: #read random numbers from file import random try: f=open(C:/users/apple/Documents/randomnum2.txt,r #open file in read mode except FileNotFoundError as: print(file not found) count=0 try: for num in

#read random numbers from file import random try: f=open("C:/users/apple/Documents/randomnum2.txt","r" #open file in read mode except FileNotFoundError as: print("file not found") count=0 try: for num in f: print(num)#print the number count+=1 #increase the count except ValueError: print ("Value Error") f.close() #close the file print("Random number count: ",count-1) #print the count keeping getting syntax error message for the "except FilenotFound" help!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!