Advertisement
Spocoman

Football Tournament

Feb 24th, 2022 (edited)
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. team = input()
  2. match = int(input())
  3. w = 0
  4. d = 0
  5. l = 0
  6.  
  7. for i in range(match):
  8.     result = input()
  9.     if result == "W":
  10.         w += 1
  11.     elif result == "D":
  12.         d += 1
  13.     elif result == "L":
  14.         l += 1
  15.  
  16. if match == 0:
  17.     print(f"{team} hasn't played any games during this season.")
  18. else:
  19.     print(f"{team} has won {w * 3 + d} points during this season.")
  20.     print("Total stats:")
  21.     print(f"## W: {w}")
  22.     print(f"## D: {d}")
  23.     print(f"## L: {l}")
  24.     print(f"Win rate: {w / match * 100:.2f}%")
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement