Dictionaries

worthingtonclinton at gmail.com worthingtonclinton at gmail.com
Sun Feb 9 02:07:50 EST 2014


why in a for loop can i access values for a dict that i did not address in the for loop. 

example:

a = {blah:blah}
b = {blah:blah}

for x in a:
    
    print a[x]
    
    #here's what i don't understand
    
    print b[x]
    
    # it would print the value for dict b even though it wasn't called upon in the for loop!


Thanks in advance.



More information about the Python-list mailing list