Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started