gpt4 book ai didi

python - 似乎无法打印出 "round 1. rounds 2, ext"

转载 作者:太空宇宙 更新时间:2023-11-04 05:55:48 27 4
gpt4 key购买 nike

guess = input("H or T?")

def game():
num_rounds()
for p1 in range(0, 2):
p1 = ("H", "T")
p2 = random.choice(p1)
guess1 = input("What was your pick?")

for p1 in p2:
if p1 == guess1:
print("I win this round!")
if p1 != guess1:
print('You win this round!')
for p1 in range(0, 8):
p1 = ("H", "T")
p2 = random.choice(p1)
guess1 = input("What was your pick?")
for p1 in p2:
if p1 == guess1:
print("I win this round!")
elif p1 != guess1:
print('You win this round!')

print("Thanks for playing!")
quit()

回合 = 10 对于范围内的回合(回合): print("圆", 圆) 游戏()

我希望它打印出来:

Round 1: Choose H or T. 

开始游戏之前

最佳答案

定义轮次,然后使用 range() 指定时间量,并使用 for 循环重复您想要的轮次。下次实际尝试一下......

关于python - 似乎无法打印出 "round 1. rounds 2, ext",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43708840/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com