Python 101 : Iterating through lists an dictionaries


 

We have the below list composed of pairs, we list it using the below:


We could also list the pairs as below:


We could also list all the elements of the list using the following:


We could list the keys of each element in a dictionary using the below:


We could list the members of a dictionary using the below:


We list the key/value for each member of the dictionary as follows:

Comments

Leave as a comment:

Archive