66.7k views
0 votes
Assume choice refers to a string. The following if statement determines whether choice is equal to Y or y.

if choice == 'Y' or choice == 'y':
Rewrite this statement so it only makes one comparison and does not use the or operator. Write this in Python

User Sungryeol
by
8.4k points

1 Answer

4 votes

Answer:

if choice.lower() == 'y':

Step-by-step explanation: