运算猜数字游戏;库的使用:turtle

mynumber =5

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

 

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

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

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

turtle.done()

posted @ 2018-05-02 21:41  王佳涵  阅读(374)  评论(0)    收藏  举报