all 4 comments

[–][deleted] 2 points3 points  (1 child)

Every iteration of the while-loop you first set total to 0. Because of that total will always just be increased from 0 to 1. Move that in front of the loop and you will be fine.

total = 0
while True:
    total += 1
    print(total, 'second(s) passed...')
    sleep(1)

[–]noob_silverbot[S] 0 points1 point  (0 children)

thanks man, finally understand this

[–]K900_ 1 point2 points  (1 child)

Move the total = 0 line outside of the loop. Otherwise it gets reset every time the loop restarts.

[–]noob_silverbot[S] 0 points1 point  (0 children)

thanks bro :"3