📜  如何计算python代码示例中的猜测次数

📅  最后修改于: 2022-03-11 14:46:47.004000             🧑  作者: Mango

代码示例1
from random import randint
guesses = 0
randomNum = (randint(0,100))
numPlayer = 0
while (numPlayer!=randomNum):
    numPlayer = int(input("Guess the number(0-100)"))
    if (numPlayer>randomNum) : 
        print "It's -"  
    elif (numPlayer