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
I have a question about this example. I did the example in the terminal, even in a text editor. It prints 1 instead of 2. Can some please one explain why is that?