Step 3: Who Actually Won? โ๏ธ
Both players throw a move... and then nothing happens. ๐ Your program has no idea who won, because nobody told it the rules yet.
The easy case is a tie: the two moves are equal.
The interesting case is winning, because there are exactly three ways
to do it. Instead of writing three separate if blocks, join them with
or โ if any one of them is true, the whole thing is true:
if (day == "sat" and sunny) or (day == "sun" and sunny):
print("Beach time!")
Each pair needs and (both parts must match), and the pairs are joined by
or. The three winning pairs: rock beats scissors, paper beats rock,
scissors beats paper.
Your mission
- Keep both picks and both prints
- If the two picks are the same โ announce a tie ๐ค
elifthe player's move beats the computer's (all three combos joined withor) โ they win! ๐elseโ the computer wins ๐ค
Your code
Press โถ Run to see what your code does!