em mới học python và tự thử thực hành code game đấm lá kéo. Mong anh chị bớt chút thời gian nhận xét chương trình em làm ạ, em cảm ơn ạ
while True:
Options = ['có','không']
print("- - "*10)
print("Hãy chọn đấm, lá hoặc kéo")
player = input("Player:")
import random
# Danh sách các biến
options = ['đấm', 'lá', 'kéo']
# Trộn danh sách và lấy phần tử đầu tiên
random.shuffle(options)
computer = options[0]
if player in options:
if player == "đấm":
print("Computer:"+ computer)
if computer=="lá":
print("You Lose")
elif computer=="kéo":
print("You Win")
elif computer == player:
print("Draw")
if player == "lá":
print("Computer:"+ computer)
if computer=="kéo":
print("You Lose")
elif computer=="đấm":
print("You Win")
elif computer == player:
print("Draw")
if player == "kéo":
print("Computer:"+ computer)
if computer=="đấm":
print("You Lose")
elif computer=="lá":
print("You Win")
elif computer == player:
print("Draw")
if player not in options:
print("Hãy thử lại")
Player = ""
print("- - "*10)
print("Bạn có muốn chơi tiếp không")
while Player not in Options:
Player = input()
if Player not in Options:
print("Hãy thử lại")
print("- - "*10)
print("Bạn có muốn chơi tiếp không")
if Player in Options:
if Player=="có":
True
if Player=="không":
print("Kết thúc trò chơi, hẹn gặp lại")
break