0

我正在制作一个对话模拟器并尝试制作随机生成的问题,这是我拥有的代码。

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。

4

0 回答 0