uaveiro-leci/1ano/fp/aula05/allMatches.py

18 lines
355 B
Python
Raw Normal View History

2022-10-20 21:22:14 +00:00
def main():
matches = allMatches(['SLB', 'FCP', 'SCP', 'SB'])
print(matches)
print(len(matches))
2022-11-09 21:56:58 +00:00
2022-10-20 21:22:14 +00:00
def allMatches(teamList):
matchList = []
2022-11-09 21:56:58 +00:00
2022-10-20 21:22:14 +00:00
for team1 in teamList:
for team2 in teamList:
2022-11-09 21:56:58 +00:00
if team1 != team2:
matchList.append((team1, team2))
2022-10-20 21:22:14 +00:00
return matchList
if __name__ == "__main__":
main()