程序执行流程/布尔类型与布尔:运算猜数字游戏;库的使用:turtle2

import turtle
turtle.fillcolor('green')
turtle.begin_fill()
turtle.shape('turtle')
turtle.circle(20)
turtle.end_fill()

turtle.up()
turtle.goto(0,-100)
turtle.down()

turtle.fillcolor('black')
turtle.begin_fill()
turtle.forward(120)
turtle.left(50)
turtle.circle(99)
turtle.end_fill()


turtle.up()
turtle.goto(0,-150)
turtle.down()
turtle.circle(220)

turtle.done
trueage = 19
while True:
    guess=int(input('请猜猜我的年龄'))
    if guess > trueage:
        print('我的年龄比这小')
    elif guess<trueage:
         print('我的年龄比这大')
    else:
        print ('恭喜你猜对啦!')
        break

猜你喜欢

转载自www.cnblogs.com/xiefei33--/p/8982698.html