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 yoichi
from typing import Tuple
def sum_by_types(items: list) -> Tuple[str, int]:
return (''.join(x for x in items if isinstance(x, str)),
sum(x for x in items if isinstance(x, int)))
March 9, 2020
Comments: