12 lines
411 B
Python
12 lines
411 B
Python
|
# take a list of teams
|
||
|
# return a round-robin schedule
|
||
|
|
||
|
teams = ["Team A", "Team B", "Team C", "Team D", "Team E", "Team F", "Team G", "Team H", "Team I", "Team J"]
|
||
|
|
||
|
# each round should have len(teams)//2 matches, as that should appropriately handle odd-numbered team counts
|
||
|
|
||
|
for r in range(1,len(teams)):
|
||
|
print("Round", r)
|
||
|
for i in range(0,len(teams)//2):
|
||
|
print(f"{teams[i]} vs. {teams[i-r]}")
|