我有以下清单:
winValues = [[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]
假设播放器变量为:
[6,3,2,4,2]
我如何检查玩家是否有一套三个中奖号码?
xlpyo6sf1#
没关系,我解决了这个问题:-)
for elem in winValues: if elem[0] in playerValues and elem[1] in playerValues and elem[2] in playerValues: print("Win!")
1条答案
按热度按时间xlpyo6sf1#
没关系,我解决了这个问题:-)