Hey! Just wondering how you make the code keep asking for a correct file input until a correct file is inputted, rather than just exiting the program when incorrect?
f = input("Enter a file name: ")
try:
infile = open(f, "r")
except:
print("File not found:", f)
text = infile.read()
print(text)