Title here
Summary here
Here we use for ... in
to sum the numbers in a list. The arrays work like this too.
for ... in
on lists provides both the index and value for each entry. Above we didn’t need the index, so we ignored it. Sometimes we actually want the indexes though.
for ... in
on dictionaries iterates over key/value pairs.
for ... in
can also iterate over just the keys of a dictionary.
for ... in
on strings iterates over characters. The enumerate
function provides both the index and character itself.