Python学习笔记-猜数字游戏(学习语法)
生活随笔
收集整理的這篇文章主要介紹了
Python学习笔记-猜数字游戏(学习语法)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
程序運(yùn)行截圖如下:
源碼如下:
import randomprint("Let's play a funny game") num=random.randint(100,999999) temp=input("please input a number while is in my mind:") while True:if(num==int(temp)):print("you're right!")print("you're a bug in my stomach!")breakelif(num>int(temp)):print("The input number is too smaller than my number!")else:print("The input number is too bigger than my number!")temp=input("please input a number once again:")pass else:print("you are winner!") print("Game over!");?
總結(jié)
以上是生活随笔為你收集整理的Python学习笔记-猜数字游戏(学习语法)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Qt工作笔记-在QTreeView上实现
- 下一篇: Qt工作笔记-QGraphics框架中,