python3 猜数字游戏

释放双眼,带上耳机,听听看~!

coding:utf-8 猜数字游戏

import random

num = random.randint(1,100)

while True:
try:
guess= int(input())
except Exception as e:
print(“请输入1~100之间的整数”)
continue
if guess > num:
print(“没有猜中哦,你输入的数字太大了”)
elif guess < num:
print(“没有猜中哦,你输入的数字太小了”)
else:
print(“恭喜你,猜中了!”)
break

【转自慕课】https://www.imooc.com

Python

Python数据挖掘03-requests库

2022-3-3 17:06:06

Python

python的函数类型详解

2022-3-3 17:13:00

搜索