Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 20 second guessing game
- # game starts here
- import time as t
- target_time = 3 # change this to 20 when finished
- print("Colin guess the time")
- print("====================")
- input("When ready press ENTER to start >> ")
- start = int(t.time())
- print("programme running...")
- input("Press ENTER again when you think the time is up >> ")
- end = int(t.time())
- guessed_time = end - start
- print("")
- if guessed_time == target_time:
- print("yabadabdoo")
- elif guessed_time < target_time:
- print("boo hoo not long enough")
- else:
- print("You guessed too high")
- print("")
- print("Statistics follow")
- print("start time was at:- ", start)
- print("end time was at:- ", end)
- print("You guessed:", guessed_time)
- print("Target time was", target_time)
Advertisement
Add Comment
Please, Sign In to add comment