# 0109.py diz={1: 1, 3: 9, 6: 36, 8: 64} for x in xrange(10): y=diz.get(x,0); print y, print # 0 1 0 9 0 0 36 0 64 0