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

19 lines
356 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
2022-11-10 19:54:11 +00:00
2022-10-20 21:22:14 +00:00
if __name__ == "__main__":
main()