26 lines
577 B
Python
26 lines
577 B
Python
def check_number(item):
|
|
return isinstance(item, (int, float))
|
|
|
|
|
|
|
|
def calculate_total_sum(nested_list):
|
|
new_summ = 0
|
|
for i in nested_list:
|
|
if isinstance(i, (list, tuple)):
|
|
new_summ += calculate_total_sum(i)
|
|
elif check_number(i):
|
|
new_summ += i
|
|
return new_summ
|
|
|
|
|
|
def process_data(data, limit):
|
|
if calculate_total_sum(data) <= limit:
|
|
return True
|
|
else:
|
|
print("Превышен лимит")
|
|
return False
|
|
|
|
|
|
print(check_number("u"))
|
|
print(process_data(data = (3,4,6,6,7,(1000,300)), limit = 100))
|