Countdown
Verfasst: Dienstag 27. September 2022, 15:25
Hallo liebe Forum-Mitglieder,
ich hab mal eine Frage zu einem Format, zum Thema "Countdown"
Hier ist erstmal mein Code.
Soweit klapp das ganz gut, aber ich möchte gerne meine Werte alle 10 Millisekunden abfangen. Wie bekomme ich das Format Millisekunden?
ich hab mal eine Frage zu einem Format, zum Thema "Countdown"
Hier ist erstmal mein Code.
Code: Alles auswählen
import time
def countdown(num_of_secs):
zahl=0
while num_of_secs:
m, s = divmod(num_of_secs, 60)
min_sec_format = '{:02d}:{:02d}'.format(m, s)
zahl = zahl+1
#print(min_sec_format,'=','Messung',zahl)
print('Messung',zahl)
for ms in range (1,10):
print(ms,'ms')
time.sleep(1)
num_of_secs -= 1
print('Countdown finished.')
inp = input('Input value: ')
countdown(int(inp))