如何去掉布尔类型呢,这个会自动把布尔类型转换成0或者1
def func(param):
if isinstance(param,list):
sum_l = 0
for x in param:
if isinstance(x,int) or isinstance(x,float):
sum_l+=x
return sum_l
elif isinstance(param,tuple):
print('tuple')
square_t=1
for y in param:
if isinstance(y,int) or isinstance(y,float):
print(y)
square_t*=y
return square_t
else:
return None
L=['3',True]
T=('3',True)
num=func(T)
print(num)
会自动把布尔类型转换成1,如何去掉布尔类型