for loop
1. for loop in list
for variable in list_name:
print variable
The variable will be assigned the value of each list item in turn.
2. for loop in dictionary
for key in dictionary_name:
print dictionary_name[key]
=======================================
Example:
webster = {
"Aardvark" : "A star of a popular children's cartoon show.",
"Baa" : "The sound a goat makes.",
"Carpet": "Goes on the floor.",
"Dab": "A small amount."
}
for x in webster:
print webster[x]
OUTPUT:
A star of a popular children's cartoon show.
Goes on the floor.
A small amount.
The sound a goat makes.
========================================