我想使用从列表中随机选择的输出,稍后再使用相同的输出。如何让它使用随机输出的相同输出,而不是另一个随机输出?你知道吗
这是我目前的代码:
print("Good you will have to do two things, first answer my question, second
guess my number")
speed = int(input("What is the top mph you have reached in the last week?"))
time = ('5','10')
print('You have traveled at' ,speed, 'mph for' ,random.choice(time),
'hours.' )
distance = int(input('How many miles have you traveled?'))
if distance == speed * int(random.choice(time)):
print('Good job, now simply guess my number.')
else:
print("Better luck next time, looks like you don't know your velocity equation")
“int”(随机选择(time))“在这里我想使用与上面两行打印中相同的输出。你知道吗
对不起,如果这是一个很容易问的问题,这是我第一次用python编程。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐