def count_small(numbers): total = 0 for n in numbers: if n < 10: total = total + 1 return total lost = [4, 8, 15, 16, 23, 42] small = count_small(lost) print small
Is the variable "small = count_small(lost)" calling the function count_small? Or what's happening here? I thought you can only call a function on a new line like count_small(lost) only, not in a variable. Thanks in advance.