Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Sum by Type by vtflnk
def sum_by_types(items: list) -> tuple[str, int]:
str_ = ''
int_ = 0
for item in items:
if isinstance(item, str):
str_ += item
else:
int_ += item
return str_, int_
Oct. 10, 2022
Comments: