所以我想为学校解决这个问题。我试图每分钟打印一次 x,每十分钟打印一次。到目前为止,我无法每分钟都得到“打印 x”。有人可以帮忙吗?这是我的代码
import time;
inTime = float(input("type in how many second"))
oldTime = time.time()-inTime
print (time.time())
def tenMin(oldTime):
newTime = time.time()
if ((newTime - oldTime)>= 25):
return True
else:
False
while (True):
if (tenMin==True):
print ("x")
newTime = time.time()
oldtime = time.time()
else:
oldTime = time.time()
continue