0
그래서 난 내 코드는 여기에 있습니다 :카운트 다운 시간은 어떻게 만듭니 까?
import time
from random import uniform
rng = uniform(1, 3)
start = time.time()
while True:
if time.time() == start + rng:
print("finally")
내 질문은 : 어떻게 "마지막으로"프로그램의 인쇄를 할 수 있습니까? `대신 :로 time.time은()> = + RNG를 시작하면
import time
from random import uniform
rng = uniform(1, 3)
start = time.time()
while True:
if time.time() >= start + rng: # first edit here (also as suggested by Patrick Haugh)
print("finally")
break # add this also to skip infinite looping
가'보십시오) –
감사합니다! 지금은 작동합니다 : D 조 – fordkuppp
''time.time()> = 시작 + rng의 경우 : '무한 루프가 있어야한다고 생각, 그 제안에도 불구하고 당신은 무한 "마지막으로 인쇄해야합니다" – oetoni