Distance=200
import time
Time_started=time.ctime()
question=(input("has car gone pass sensor 1 \n:"))
if question=="yes":
print ("the time is",Time_started,"seconds")
Time_ended=time.ctime()
question2=(input("has car gone pass sensor 2 \n:"))
if question2=="yes":
print ("the time is",Time_ended,"seconds")
print ("")
Time_taken= (time.ctime() - Time_started)
print ("it took %f1 seconds" % Time_taken , "to travel 200m")
我想知道是否有可能採取time.ctime彼此遠離自己拿到秒我怎麼能採取time.ctime從time.ctime遠
是否有一個原因,你明確使用time.ctime?因爲time.time()會以秒爲單位返回時間(浮點數)。 – SwedishOwlSerpent
沒有特定的原因,除了我更喜歡time.ctime設置的方式 – HELP