Programming-Challenges/08 IF&ELIF Statements/exercise-02.py

21 lines
651 B
Python

# get names of two football teams and their scores
# 3 points if they win, 1 for draw, 0 for loss
WIN = 3
DRAW = 1
LOSS = 0
team1 = input("Enter the name of the first team: ")
team2 = input("Enter the name of the second team: ")
score1 = int(input("Enter the score of the first team: "))
score2 = int(input("Enter the score of the second team: "))
if score1 > score2:
print(f"{team1} wins with a score of {WIN}")
print(f"{team2} loses with a score of {LOSS}")
elif score1 < score2:
print(f"{team2} wins with a score of {WIN}")
print(f"{team1} loses with a score of {LOSS}")
else:
print(f"The teams tied with a score of {DRAW}")