<doocs>2125.Number of Laser Beams in a Bank_1.py
def numberOfBeams( bank: List[str]) -> int:
    last = ans = 0
    for b in bank:
        if (t := b.count('1')) > 0:
            ans += last * t
            last = t
    return ans
def sample_funcname ( var_0 : List [ str ] ) -> int :
    var_6 = var_4 = 0
    for var_7 in var_0 :
        if ( var_8 := var_7.count ( '1' ) ) > 0 :
            var_4 += var_6 * var_8
            var_6 = var_8
    return var_4
