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

mynumber=50
while True:
    guess=float(input('请输入一个数字'))
    if guess>mynumber:
        print('数字猜大了')
    elif guess<mynumber:
        print('数字猜小了')
    else:
        print('恭喜你猜对了')
        break

  

import turtle
turtle.fillcolor('red')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()

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

turtle()
turtle.goto(0,-100)
turtle.down()
turtle.circle(150)

turtle.down()

  

posted on 2018-05-09 19:12  周天凯  阅读(91)  评论(0编辑  收藏  举报