Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 04. Darts
- player = input()
- pole = None
- while pole != "Retire" or scores_end != 0:
- pole = input()
- score = int(input())
- fail = 0
- success = 0
- scores_end = 301
- if scores_end <= 301 and scores_end > 0 and fail < 3:
- if pole == "Triple":
- score = (score * 3)
- scores_end = scores_end - score
- success += 1
- if score > scores_end:
- fail += 1
- elif pole == "Double":
- score = (score * 2)
- scores_end = scores_end - score
- success += 1
- if score> scores_end:
- fail += 1
- elif pole == "Single":
- score = (score * 1)
- scores_end = scores_end - score
- success += 1
- if score > scores_end:
- fail += 1
- else:
- success += 1
- print(f"{player} won the leg with {success} shots.")
- if pole == "Retire":
- print(f"{player} retired after {fail} unsuccessful shots.")
Advertisement
Add Comment
Please, Sign In to add comment