3 ms·
To teach for loops, I start with this example: word = "banana" for letter in word: print letter It isn't a counter, but it makes it clear that print i
by mapmeld 14y ago
To teach for loops, I start with this example:
word = "banana"
for letter in word:
print letter
It isn't a counter, but it makes it clear that print is happening for each part of the word. Then you can write programs using arrays and other counters.