Why are arbitrary target expressions allowed in for-loops? – stackoverflow.com 20:10 Posted by Unknown No Comments I accidentally wrote some code like this: foo = [42] k = {'c': 'd'} for k['z'] in foo: # Huh?? print k But to my surprise, this was not a syntax error. Instead, it prints {'c': 'd', 'z': 42}. ... from Hot Questions - Stack Exchange OnStackOverflow via Blogspot Share this Unknown
0 Comment to "Why are arbitrary target expressions allowed in for-loops? – stackoverflow.com"
Post a Comment