[训练] 蟒蛇 – 终极密码

ans = 38

min = 0
max = 100

while(True):
    guess = int(input("Please input a number that between %d ~ %d : "%(min, max)))
    if (guess > ans):
        max = guess
    if (guess < ans):
        min = guess
    if (guess == ans):
        print("Bingo!!")
        break

本网站使用的Akismet,以减少垃圾邮件. 了解您的意见如何处理数据.

0 评论
内联反馈
查看所有评论