Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

you wrote a program where you played rock, paper, scissors against the …

Question

you wrote a program where you played rock, paper, scissors against the computer. you allowed the user to enter either upper - or lowercase answers. complete the code so that the comparison to rock will work. play = input(\enter rock, paper, or scissors, or a q to quit. \) play = play. () if play == \q\: keepgoing = false elif play == compplay: print(\you both chose the same. no winner. \)

Explanation:

Step1: Analyze the requirement

The code needs to handle both upper - and lowercase inputs. The lower() method in Python converts a string to lowercase.

Step2: Apply the method

Since the comparison in the if statements (e.g., play == "q" and play == compPlay) is done with lowercase strings, we should convert the user input (stored in play) to lowercase. So the missing part is lower.

Answer:

lower