as it is now, it will ask for user input twice.
posx = 0 posy = 0 while True: user_choice = input().lower() if user_choice == "forward": posy += 1 print(posy) elif user_choice == "backward": posy -= 1 print(posy) elif user_choice == 'exit': # provide way to exit the loop break
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs