要求
导入random模块,利用 random.randint(1,100) 生成一个0-100之间的随机整数,将这个值赋值给number,如果number大于等于60,则输出pass,不然输出not pass
代码如下
import random
number = random.randint(1,100)
print(number)
if number>=60:
print("pass")
else:
print("not pass")
导入random模块,利用 random.randint(1,100) 生成一个0-100之间的随机整数,将这个值赋值给number,如果number大于等于60,则输出pass,不然输出not pass
import random
number = random.randint(1,100)
print(number)
if number>=60:
print("pass")
else:
print("not pass")