Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
185 B
0
Indexable
Never
def sum_by_types(items):
    result = ['', 0]
    for item in items:
        result[isinstance(item, int)] += item
    return result
#
print(list(sum_by_types(["1", 'ss', 2, 3])))