猜年龄游戏

age=22
counter=0
for i in range(10):
    if counter<3:
        guess_num=int(input("请猜年龄"))
        if guess_num==age:
            print("恭喜你猜对了")
            break
        elif guess_num >age:
            print("太大了")
        else:
            print("太小了")
    else:
        continue_isntit=input("你猜了太多次了真笨是否继续?输入:q 继续")
        if continue_isntit=="q":
            counter=0
            continue
        else:
            break

    counter += 1

 

posted @ 2016-11-25 19:16  200六  阅读(158)  评论(0编辑  收藏  举报