我正在制作会话模拟器,我正在尝试制作随机生成的问题,这是我的代码。
import time
print ("Hello")
time.sleep(2)
age = input("How old are you?")
time.sleep(2)
if age.isdigit() and age >= str(0):
print ("Ok, cool I am " + age + " too.")
time.sleep(2)
yourname = input("What is your name again?")
print ("Cool, " + yourname + " is a nice name")
time.sleep(2)
name = input("Do you remember my name?")
print ("Ya my name is " + name + " you got it")
from random import randint
print(randint(0,4))
elif randint = 1
print ("hello")
elif randint = 2
print ("hello")
elif randint = 3
print ("hello")
elif randint = 4
print ("hello")
elif randint = 5
else:
print ("ERROR")
我试图从随机整数值中随机提问。 老实说,我不知道出了什么问题,我还在学习python 3.5。