# Enter a code
def type_cal(t, e):
result = None
i = 0;
for item in e:
if isinstance(item, int) or isinstance(item, float):
if i == 0:
result = item
i += 1
else:
if "1" == t:
result += item
else:
result *= item
return result
def func(e):
result = None
if isinstance(e, list):
data = []
result = type_cal('1', e)
elif isinstance(e, tuple):
result = type_cal('2', e)
return result;
e1 = [1,2,3,4,5]
e2 = ['a', 'b', 'c', 'd']
e3 = (2, 5, 'a', 2.5, [1, 2, 3])
e4 = ('a', 'b', 'c', 'd')
print(func(e1))
print(func(e2))
print(func(e3))
print(func(e4))