heads-n-tails.py 356 B

1234567891011121314151617181920
  1. import random
  2. def print_result():
  3. result = ""
  4. if random.randint(0, 1) == 1:
  5. result += "Heads"
  6. else:
  7. result += "Tail"
  8. print("Your result is: " + result)
  9. print_result()
  10. while True:
  11. if input("Another Y/N ").lower() == "y":
  12. print_result()
  13. else:
  14. print("The end")
  15. break