from typing import Iterable
# flatten any number of nested iterables (lists, tuples)
def flatten_iterables(iterable: Iterable) -> list:
"""Convert iterables (lists, tuples) to list (excluding string and dictionary)
Args:
iterables (Iterable): Iterables to flatten
Returns:
list: return a flattened list
"""
lis = []
for i in iterable:
if isinstance(i, Iterable) and not isinstance(i, str):
lis.extend(flatten_iterables(i))
else:
lis.append(i)
return lis