def count_items(lst):
count = 0
for item in lst:
if isinstance(item, list):
count += count_items(item)
else:
count += 1
return count
print(count_items([1, [2, 3], [4, [5]]]))
Post #3017
688
Что выведет код?