我的代码给了我作为列表的输出
def extractKeywords():
<code>
return list
list = []
data = extractKeywords()
for x in range(0,5):
get = data[0][x]
list.append(get)
print list12
输出列表是
['LION', 'tv', 'TIGER', 'keyboard', 'cd-writer','ELEPHANT']
我如何将此列表分为两组,例如(预期输出)
Animals = ['LION', 'TIGER', 'ELEPHANT']
Electronics = ['tv', 'keyboard', 'cd-writer']
所有动物都在Capital letter
,电子设备在small letters