gpt4 book ai didi

python - 所有可能的结果,需要循环

转载 作者:太空宇宙 更新时间:2023-11-03 12:27:19 24 4
gpt4 key购买 nike

<分区>

我有一份所有英超球队的名单:

teamlist = ["arsenal", "aston-villa", "bournemouth", "chelsea", "crystal-palace", "everton","leicester-city", "liverpool", "manchester-city", "manchester-united", "newcastle-united", "norwich-city", "southampton","stoke-city", "swansea-city", "tottenham-hotspur", "watford", "west-bromich-albion","west-ham-united" ]

我需要计算所有可能的 team1-vs-team2 配对。

目前我有以下代码:

oppo = 0

for team in teamlist:
print team + "-vs-" + teamlist[oppo]
oppo+=1
print team + "-vs-" + teamlist[oppo]
oppo+=1

将输出:

arsenal-vs-arsenal
arsenal-vs-aston-villa

但是我需要这个来遍历每支球队,显示他们所有可能的主场比赛赛程,然后移动到球队列表中的下一支球队,输出他们所有可能的主场比赛赛程并重复直到所有球队都完成。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com