Advertisement
Guest User

football_results

a guest
Mar 1st, 2020
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. results = [input().split(':') for result in range(3)]
  2.  
  3. win = 0
  4. lose = 0
  5. draw = 0
  6.  
  7. for _ in range(len(results)):
  8.     team_A_goals = int(results[0][0])
  9.     team_B_goals = int(results[0][1])
  10.  
  11.     if team_A_goals > team_B_goals:
  12.         win += 1
  13.     elif team_A_goals < team_B_goals:
  14.         lose += 1
  15.     else:
  16.         draw += 1
  17.  
  18.     results.remove(results[0])
  19.  
  20. print(f'Team won {win} games.')
  21. print(f'Team lost {lose} games.')
  22. print(f'Drawn games: {draw}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement