from datetime import datetime
platenumber = input("Enter the license plate number:")
start = input("Press enter to start.")
starttime =(datetime.now())
stop = input("Press enter to stop.")
stoptime =(datetime.now())
dist1 = 0
dist2 = input("Enter the distance of the road in metres:")
time = ((stoptime - starttime).total_seconds())
print((time),"is the time in seconds.")
distance = int(dist2) - dist1
print((distance),"is the the distance in metres.")
speed = float(distance)//time
print((speed),"is the speed of the vehicle in m/s.")
我想在使用它之后重新启动程序,以便我可以检查车辆的速度不止一次。重新启动自己的程序?
请帮我完成代码,以便我可以自行重新启动代码并检查多个车辆的速度。
帮助我的代码,可以帮助的代码中本身重启像连续循环 – 2015-03-24 21:07:16
为什么你不只是用'while'循环? – Makoto 2015-03-24 21:07:39
*“给我代码”* - 不,请自己完成GCSE课程。 – jonrsharpe 2015-03-24 21:07:47