Back to Freecodecamp

For Loops

curriculum/challenges/english/blocks/dictionaries-and-loops/for-loops-video.md

latest589 B
Original Source

--description--

In this video, you will learn how to use for loops to iterate over sequences like lists and ranges.

--questions--

--text--

Which of the following is the correct way to iterate over each letter in the string "Giraffe Academy"?

--answers--

python
for (letter) in "Giraffe Academy":
    print(letter)

python
for key, letter in "Giraffe Academy":
    print(letter)

python
for letter in "Giraffe Academy":
    print(letter)

python
for letter, value in "Giraffe Academy":
    print(letter)

--video-solution--

3