playerdeck = ['Ten of Clubs','Six of Diamonds','Five of Hearts', \
'Jack of Spades','Five of Diamonds','Queen of Clubs','Seven of Diamonds']
for i,item in enumerate(playerdeck):
if 'Ten' in item:
print('Yes:',i,item)
playerdeck = ['Ten of Clubs', 'Six of Diamonds', 'Five of Hearts', 'Jack of Spades', 'Five of Diamonds', 'Queen of Clubs', 'Seven of Diamonds']
s="Ten"
for i in playerdeck:
if s in i:
print(i)
print("Found")
请尝试以下操作
结果
试试这个:
你可以使用:
或者如果你只是想知道甲板上有没有10个:
相关问题 更多 >
编程相关推荐