Here's my problem:
Lets say I have two dictionaries, dict_a and dict_b.
Each of them have similar keys and values that I can manipulate in the same way, and in fact that's what I'm doing in a large piece of code. Only I don't want to have to write it twice. However, I can't do something like this:
if choose_a == 1:
for x and y in dict_a.iteritems():
# goto line 20
if choose_b == 1:
for x and y in dict_b.iteritems():
# goto line 20
# line 20
# do stuff with x and y.
Except I have no idea what to do in a situation like this. If there is a like thread, please point me to it, and forgive me if I have violated anything (first post). Thanks in advance, I appreciate any help.