Answer to Question #350650 in Python for Syed

Question #350650

Write a program to find the winner of each round of game based on the shape of players chose


1
Expert's answer
2022-06-14T09:41:32-0400
from random import choice
shapes = ['circle', 'triangle', 'square', 'elipse', 'diamond', 'rectangle', 'star', 'heart']
print(', '.join(shapes))
secret_shape = choice(shapes)
user_shape = (input("Your choice: ").strip()).lower()
while user_shape != secret_shape:
    print("You are wrong!")
    user_shape = (input("Your choice: ").strip()).lower()
print("Congratulations! You won!")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS