【发布时间】:2022-11-12 01:10:31
【问题描述】:
我正在制作一个快速的问题解决器,它需要速度(输入)和时间(也是输入)而不是乘以它们以获得距离......问题是python认为输入是字符串,我如何让它们成为数字? ?
到目前为止,我的代码是:
py
import random
time = input("What is the time it took? (no label :: ")
speed = input("What was the speed?(no label :: ")
s = speed
t = time
distance = s * t
print(time)
print(speed)
print(distance)
【问题讨论】: