Advertisement
exDotaPro

27_july_2019_4_darts_tournament

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