python - Remove from list after correct twice and stopwatch -


i'm creating quiz , i'm new python please go easy on me! trying create stopwatch display time taken after quiz has ended , not while still ongoing. tried implementing code using

import time import os s=0 m=0 h=0 while s<=60:     os.system('cls')     print (h, 'hours',  m, 'minutes', s, 'seconds'     time.sleep(1)     if s ==60:         m+=1         s=0     elif m == 60:         h+=1         m=0         s=o 

and worked continuously telling time , quiz wouldn't start. want display total time @ end. tips?

furthermore, have no idea start this. want implement piece of code when user matches random word correct definition twice, want word disappear (i'd keep definition 3 random definitions listed.)

here extract words -

h=0 h in range (len(words)):         if randomkey == words [x]:             position = x   word = definitions[position] 

thanks suggestions given!

instead of trying keep track of time passing, record time @ start, record again @ end, , subtract time passed:

import time start = time.time() # stuff end = time.time() duration_in_seconds = end - start 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -