13
Just like a list! If you say for letter in "Lagos":, the loop will run 5 times, once for 'L', once for 'a', and so on.
This is very useful if you want to count how many vowels are in a sentence or if you are looking for a specific character. Python makes it very easy.
Log in to add a comment.