Python Loop Through an Array


Looping Array Elements

You can use the for in loop to loop through all the elements of an array.

Example

Print each item in the cars array:

for x in cars:
  print(x)
Try it Yourself »


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.