For this first part, prompt the user for the name of the file containing the keywords, check to make sure that the file exists and if does not exist, my program should generate an exception and exit. Have I done this part right?
done = False
while not done:
try:
keywords = input("Enter file named keywords.txt: ")
infile = open(keywords, "r")
done = True
except IOError :
print("Error: file not found.")
exit()
try:
tweets = input("Enter file named tweets.txt: ")
infile = open(tweets, "r")
done = True
except IOError :
print("Error: file not found.")
exit() #Should exit if doesnt exist? Doesnt say in assignment
Ignore the #statement lol