based on metulburr's suggestion:
in addition one could use dict comprehension to construct the dict
>>> d = { 1:1, 2:10, 3:100, 4:1000, 5:10000 } >>> n = d.get(integerLength, 100000)
in addition one could use dict comprehension to construct the dict
d = {k+1:10**k for k in range(5)}