1. 程式人生 > >猜數字遊戲;庫的使用:turtle

猜數字遊戲;庫的使用:turtle

break 個數字 port image mage img 輸入 put spa

>>> import turtle
>>> turtle.circle(10)
>>> turtle.circle(20)
>>> turtle.circle(30)
>>> turtle.circle(40)
>>> turtle.circle(50)
>>>

技術分享圖片技術分享圖片技術分享圖片

>>> myNUM = 6
>>> print(猜數字大小遊戲/n)
猜數字大小遊戲/n
>>> while True:
    guess = int(input(
請輸入一個數字:)) if guess > myNUM: print(猜大了) elif guess < myNUM: print(猜小了) else: print(恭喜恭喜恭喜你呀,猜對了!) break

技術分享圖片

猜數字遊戲;庫的使用:turtle