def func(listLorLtuple):
if listLorLtuple is list:
for l in listLorLtuple:
return listLorLtuple[0],listLorLtuple[1],listLorLtuple[2],listLorLtuple[3],listLorLtuple[4],listLorLtuple[5],listLorLtuple[6],listLorLtuple[7],listLorLtuple[8],listLorLtuple[9],listLorLtuple[10]
if listLorLtuple is tuple:
return listLorLtuple[0]*listLorLtuple[1]*listLorLtuple[2]*listLorLtuple[3]*listLorLtuple[4]*listLorLtuple[5]*listLorLtuple[6]*listLorLtuple[7]*listLorLtuple[8]*listLorLtuple[9]*listLorLtuple[10]
L = [1,2,3,4,5,6,7,8,9,10]
T = (1,2,3,4,5,6,7,8,9,10)
print(func(L))
print(func(T))
应该用isinstance(listLorLtuple, list):判断类型