There've been some improvements to this challenge, and the experience should be a lot smoother!
Check out the Hints and Answer sections below if you need help, and please after that post any feedback or questions you have below, and we and other users can help out!
- Remember to use
== in ifs and elifs, not
- Put a
: at the end of each
elif and the
- Output from the
prints must match exactly, including spaces. You can copy and paste from the Task in the challenge.
You can use the in-challenge per-Task Solutions and the entire Answer, and can use the Toggle Navigation button (or Table of Contents button) at the top of the challenge to move forward so you're not stuck!
You can check out the Answer below or post a question too!
- As it refers to an older version of the challenge, not the greatest option, but there may be some useful information in the old 3.9 topic. It's more here for recording changes and transparency, though. Do let us know if a post in there helped, and we'll post the information here!
computer_choice = 'rock'
user_choice = input("Enter rock, paper, or python:\n")
if computer_choice == user_choice:
elif user_choice == 'rock' and computer_choice == 'python':
elif user_choice == 'paper' and computer_choice == 'rock':
elif user_choice == 'python' and computer_choice == 'paper':
print('You lose :( Computer wins :D')
If you needed to use the answer, please also post the reason below, as further improvements can be made!