Menu
Coddy logo textTech

Recap - Tournament Tracker

Part of the Logic & Flow section of Coddy's Python journey — lesson 38 of 78.

challenge icon

Challenge

Hard

In a competitive gaming tournament, players participate in different matches. Your task is to analyze player participation across three matches using Python sets.

You'll be given three sets of players:

  • match1: Players who participated in Match 1
  • match2: Players who participated in Match 2
  • match3: Players who participated in Match 3

Your task is to:

  1. Find players who participated in all three matches
  2. Identify players who participated in exactly two matches
  3. Determine players who participated in only one match
  4. Count the total number of unique players in the tournament
  5. Find players who participated in Match 1 but not in Match 2 or Match 3

Print the results in the following format:

  • Use sorted(list(set_name)) to display players in alphabetical order
  • Print the exact output format shown in the example

Example Input:

{"Alice", "Bob", "Charlie", "Diana"}
{"Charlie", "Diana", "Eve", "Frank"}
{"Alice", "Diana", "Frank", "George"}

Example Output:

Players in all matches: ['Diana']
Players in exactly two matches: ['Alice', 'Charlie', 'Frank']
Players in only one match: ['Bob', 'Eve', 'George']
Total unique players: 7
Players in Match 1 only: ['Bob']

Try it yourself

# Read input for the three matches
match1 = eval(input())
match2 = eval(input())
match3 = eval(input())

# 1. Find players who participated in all three matches

# 2. Find players who participated in exactly two matches

# 3. Find players who participated in only one match

# 4. Count total unique players

# 5. Find players in Match 1 only

# Print results in the specified format

All lessons in Logic & Flow