已采纳回答 / 慕村4040375
not isinstance(L,list) or not isinstance(L,tuple)这个条件相当于L既是list也是tuple才是false,实际上L只能是list,或者只能是tuple,所以条件就永远都是true可以试试改成not isinstance(L,list) and not isinstance(L,tuple),或者not (isinstance(L,list) or isinstance(L,tuple))
2021-07-15
已采纳回答 / 慕后端4297166
d = { 'Alice': [45], 'Bob': [60], 'Candy': [75],}a=[50,61,60]b=[80,61,66]c=[88,75,90]for i in a: d['Alice'].append(i)for i in b: d['Bob'].append(i)for i in c: d['Candy'].append(i)print(d)
2021-07-15