Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import time
- random_list = []
- for i in range(10, 21):
- random_list.append(i)
- counter = 0
- while True:
- counter += 1
- random_sec = random.choice(random_list)
- counter_sec = random_sec
- tic = time.perf_counter()
- while True:
- toc = time.perf_counter()
- if toc - tic > 1:
- counter_sec -= 1
- print(counter_sec)
- tic = toc
- if counter_sec <= 0:
- print("Bang!")
- break
- if counter > 5:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement