代码改变世界

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

2018-05-02 21:37  lulululululululu  阅读(216)  评论(0编辑  收藏  举报
myNumber = 7

while True:
    guess = int(input('猜猜这个数字是什么'))
    if guess > myNumber:
        input('这个数字大了')
    elif guess < myNumber:
        input('这个数字小了')
    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.fillcolor('yellow')
turtle.begin_fill()
turtle.circle(100)
turtle.end_fill()

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

turtle.done()