Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- won = 0
- lost = 0
- drawn = 0
- for i in range(3):
- game = input()
- if game[0] > game[2]:
- won += 1
- elif game[0] < game[2]:
- lost += 1
- else:
- drawn += 1
- print(f"Team won {won} games.")
- print(f"Team lost {lost} games.")
- print(f"Drawn games: {drawn}")
- РЕШЕНИЕ С РЕЧНИК И ТЕРНАРЕН ОПЕРАТОР:
- result = {'won': 0, 'lost': 0, 'drawn': 0}
- for i in range(3):
- game = input()
- result[{game[0] > game[2]: 'won', game[0] < game[2]: 'lost', game[0] == game[2]: 'drawn'}[True]] += 1
- print(f"Team won {result['won']} games.")
- print(f"Team lost {result['lost']} games.")
- print(f"Drawn games: {result['drawn']}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement