#这是一个简单的python猜数字游戏,程序版本python3(3.8.5)
#注意格式错误,重新调整缩进
import random
if __name__ == '__main__':
yourname = input ("欢迎进入ul00.com,学习python小程序实例,猜数字游戏!请输入你的名字?\n");
print ("你好,"+yourname)
print ("准备好了吗?游戏即将开始了")
print ("我将选择一个数字在1到50之间,你能猜到吗?")
random_num = random.randint(1,50)
time = 0
while time < 5:
num = int (input("请输入你的数字:"))
if num == random_num:
break;
elif num < random_num:
print ("你猜的数字小了!")
else:
print ("你猜的数字比我的大!")
time = time +1
if time < 5:
print ("恭喜你赢了^_^ ")
else:
print ("失败了,可以再来一次的哦⊙o⊙,正确答案是"+str(random_num))
未经允许不得转载:萌萌Apprentissage » Python numeric guess game
Python batches to extract mainstream search engine pictures
Python's word crawling across 100 degrees.
PythonTaiichi Taipei Artificial Intelligence Tensoflow Graphic Processing
Selenium with Tor Browser using Python
I'm gonna get you a new one, shell.cloud.google on the line.
run crontab with python selenium tor browser display in linux
Lineux Environment Use python to call the ter browser random browser web page