ÎncepețiÎncepe gratuit

Loop over a vector

In the video, you saw how a for loop can be used to easily and efficiently iterate over an iterable structure. In this example, let's practice this by iterating over a vector using a for loop to print all the elements of that vector to the console.

Acest exercițiu face parte din cursul

Intermediate Julia

Vezi cursul

Instrucțiuni pentru exercițiu

  • Write a for loop to iterate over the vector stock_tickers, printing each element of the vector on a new line.

Exercițiu interactiv practic

Încearcă acest exercițiu completând acest cod de exemplu.

# Loop over stock_tickers and print each element
for value in ____
  ____(____)
end
Editează și rulează codul