大于但小于python使用中的函数

时间:2019-02-14 14:23:13

标签: python

2 个答案:

答案 0 :(得分:1)

您的elif语句不以:结尾!

答案 1 :(得分:0)

您错过了2个冒号

while guess != rightnum:

    guess=int(input('your guess: '))
    diff= abs(guess - rightnum)

    if guess > rightnum and diff >= 1000 :
        print(random.choice(muchless))
    elif guess > rightnum and 1000 > diff >= 100 :
        print(random.choice(less))
    elif guess > rightnum and diff < 100 :
        print(random.choice(fewless))