小编use*_*991的帖子

为什么我的 python if 语句不起作用?

我希望有一个人可以帮助我。当我运行下面的函数时,无论输入什么,都会打印规则。我看不出我做错了什么。

def check_rules():
    while True:
       request = input("\nWould you like to know the rules? (y/n) ")
       if request == "y" or "Y":
           print("""
1. Each player takes it in turn to roll a dice.
2. The player then turns over a card with the same
   number as the number rolled to see how many ladybirds
   there are (0-3).
3. The player keeps the card.
4. If a player rolls a number that is not on an unclaimed
   card, play continues …
Run Code Online (Sandbox Code Playgroud)

python python-3.x

3
推荐指数
1
解决办法
5万
查看次数

标签 统计

python ×1

python-3.x ×1