Here is my code:
print "Note: Your file is available now."
viewYourFile = raw_input("\nDo you wish to view this file now? ")
if viewYourFile == 'Y' or 'y':
fo = open('messages.txt', 'r+')
#Read whole file into data
data = fo.read()
print data
# Close the file
fo.close()
elif viewYourFile == 'N' or 'n':
print "Thank you!"
else:
print "Didn't recognize user input"
When I type in 'n' the text file still opens. If the user types in 'N' or 'n' I want the script to move on without printing the text into the terminal.
I can't spot anything obvious that I've done wrong. Can someone take a second look for me? Many thanks.