Daily Python Projects
Python Code Dictations
Finding the Length of Each Word in a Sentence with a For-Loop - Python Code Dictation
2
0:00
-1:56

Finding the Length of Each Word in a Sentence with a For-Loop - Python Code Dictation

Level: Easy 🟡
2

What is this post about?

This is an audio code dictation to help learners memorize Python syntax. Follow these steps to complete a dictation:

  1. Open a code editor on your computer.

  2. Play the audio and type the narrated code while listening.

  3. Compare your code with the correct code below.

Correct Code

sentence = "The weather is good"
words = sentence.split()

word_lengths = []
for word in words:
    word_lengths.append(len(word))

print(sentence)
print(words)
print(word_lengths)

Explore More Dictations

Discussion about this episode

User's avatar