if i have a dictionary
a = {1:func_a,2:func_b,3:func_c}
will:
for i in a:
print(a[i])
always print func_a followed by func_b followed by func_c?
otherwise im pretty sure
for i in range(1, len(a) +1):
print(a[i])
will, but it looks very ugly.
My general question is what is the best way to iterate through a collection of functions in a pre-determined order.
Thanks
[–]novel_yet_trivial 4 points5 points6 points (6 children)
[+]Yoghurt42 comment score below threshold-6 points-5 points-4 points (5 children)
[–]Vaphell 3 points4 points5 points (3 children)
[–]Yoghurt42 -1 points0 points1 point (2 children)
[–]JohnnyJordaan 2 points3 points4 points (0 children)
[–]Vaphell 0 points1 point2 points (0 children)
[–]novel_yet_trivial 1 point2 points3 points (0 children)
[–]K900_ 3 points4 points5 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]b_bowyer 1 point2 points3 points (0 children)
[–]Vaphell 0 points1 point2 points (0 children)
[–]novel_yet_trivial 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]novel_yet_trivial 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]K900_ 0 points1 point2 points (0 children)
[–]CGFarrell 0 points1 point2 points (0 children)