Advertisement
simeonshopov

Darts Tournament (late july exam)

Nov 5th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. points = int(input())
  2. moves = 0
  3.  
  4. while points >= 0:
  5.   if points == 0:
  6.     print(f"Congratulations! You won the game in {moves} moves!")
  7.     break
  8.   else:
  9.     sector = input()
  10.     moves += 1
  11.     if sector == "bullseye":
  12.       print(f"Congratulations! You won the game with a bullseye in {moves} moves!")
  13.       break
  14.     score = int(input())
  15.     if sector == "number section":
  16.       points -= score
  17.     elif sector == "double ring":
  18.       points -= score * 2
  19.     elif sector == "triple ring":
  20.       points -= score * 3
  21. else:
  22.   print(f"Sorry, you lost. Score difference: {abs(points)}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement