diff --git a/guide/english/python/for-loop-statements/index.md b/guide/english/python/for-loop-statements/index.md index 0a046441a2e..9ab7eb5e076 100644 --- a/guide/english/python/for-loop-statements/index.md +++ b/guide/english/python/for-loop-statements/index.md @@ -121,6 +121,26 @@ thank you [2, 3] > ``` +**Iterate over characters in a string** +```python +for char in "How fun!": + print("Current char: "+char) +``` +Output: + +``` +> +Current char: H +Current char: o +Current char: w +Current char: +Current char: f +Current char: u +Current char: n +Current char: ! +> +``` + **Iterate over keys in a dictionary (aka hashmap)**