I'm very new to programming and I'm sorry if this is an easy question. I want the code to replay itself after specific user inputs without having to manually run the code every time.
I've looked through similar questions on here and I see that others have had similar queries but I don't understand the answers given. I've tried the def main()
at the beginning and put main()
where I want the code to reset, but then the prompt for user input just doesn't show up.
def main():
number = int(input("Please enter an integer between 0 and 127: "))
if number > 127 or number < 0:
print("I'm sorry, that is not an acceptable value. Please try again")
main()
elif number <= 127 and number >= 0:
print("WIP")
else:
print("I'm sorry, something went wrong. Please try again and be sure to enter an integer between 0 and 127.")
main()