Just wondering

https://www.codecademy.com/paths/computer-science/tracks/cspath-flow-data-iteration/modules/dspath-python-loops/lessons/learn-python-loops/exercises/continue
I know I should’ve put “print(age)”
I am just wondering when "print(ages) why does it prints ages list 6 times?

ages = [12, 38, 34, 26, 21, 19, 67, 41, 17]
for age in ages:
  if age < 21:
    continue
  print(ages)

your list is called ages, thats why print(ages) prints the whole list

1 Like