Recently I've got a small problem with if else statement. Namely I want to create a function that asks user for input whether he wants to read the file that script has created or not, so if the input is correct function does its thing however when input is incorrect I want it to revert to question again.
Here's the code:
def read_the_file(output):
print """
Do you want me to read your newly created file?
Type [Y]es or [N]o
"""
question = raw_input("> ")
reading = output.read()
if question == 'yes'or question == 'Y' or question == 'y':
print "BEGINNING OF FILE\n\n" + reading + "\n END OF FILE"
elif question == 'no' or question == 'N' or question == 'n':
sys.exit[1]
else :
print "wrong input"
read_the_file(output_file)
so what I'd like the function to do is instead write
else:
print "wrong input"
is to go back and repeat itself.