laflame

Aryan Shahane, Sugamay Gakhar, Jishnu Ganisetti

def find_winner(player_scores): max_score = max(player_scores) winners = [i + 1 for i, score in enumerate(player_scores) if score == max_score] if len(winners) == 1: return winners[0] else: return "It's a tie!"

def main(): player_scores = [] for i in range(3): score = float(input(f"Enter the score for player {i+1}: ")) player_scores.append(score)

winner = find_winner(player_scores) if winner != "It's a tie!": print(f"Player {winner} wins with a score of {player_scores[winner - 1]}!") else: print("It's a tie! All players have the same score.")

if name == "main": main()

Built With

Share this project:

Updates