Using 2 dictionaries in python
Question: I'm trying to create a code that if the user types his first name and his
middle name initial into the input it will add the two dictionary numbers
together.

**For the first name values I want:**

    
    
        d['a'] = 0
        d['b'] = 60
        d['c'] = 100
        d['d'] = 160
        d['e'] = 200
        d['f'] = 240
        d['g'] = 280
        d['h'] = 320
        d['i'] = 400
        d['j'] = 420
        d['k'] = 500
        d['l'] = 520
        d['m'] = 540
        d['n'] = 620
        d['o'] = 640
        d['p'] = 660
        d['q'] = 700
        d['r'] = 720
        d['s'] = 780
        d['t'] = 800
        d['u'] = 840
        d['v'] = 860
        d['w'] = 880
        d['x'] = 940
        d['y'] = 960
        d['z'] = 980
    

**Middle name initial values I want:**

    
    
        d['a'] = 1
        d['b'] = 2
        d['c'] = 3
        d['d'] = 4
        d['e'] = 5
        d['f'] = 6
        d['g'] = 7
        d['h'] = 8
        d['i'] = 9
        d['j'] = 10
        d['k'] = 11
        d['l'] = 12
        d['m'] = 13
        d['n'] = 14
        d['o'] = 14
        d['p'] = 15
        d['q'] = 15
        d['r'] = 16
        d['s'] = 17
        d['t'] = 18
        d['u'] = 18
        d['v'] = 18
        d['w'] = 19
        d['x'] = 19
        d['y'] = 19
        d['z'] = 19
    

**Code so far:**

    
    
    first_name = raw_input("what is your first name?: ")
    middle_initial = raw_input("What is your middle initial?: ")
    
        #First Name Initial Values
        d = {}
        d['a'] = 0
        d['b'] = 60
        d['c'] = 100
        d['d'] = 160
        d['e'] = 200
        d['f'] = 240
        d['g'] = 280
        d['h'] = 320
        d['i'] = 400
        d['j'] = 420
        d['k'] = 500
        d['l'] = 520
        d['m'] = 540
        d['n'] = 620
        d['o'] = 640
        d['p'] = 660
        d['q'] = 700
        d['r'] = 720
        d['s'] = 780
        d['t'] = 800
        d['u'] = 840
        d['v'] = 860
        d['w'] = 880
        d['x'] = 940
        d['y'] = 960
        d['z'] = 980
    
        lower = first_name.lower()
        first_initial = lower[0]
    
        if first_initial in d:
            print d[first_initial]
    

**Example:**

For example if I type Josh for the first name and J for the middle name
initial the output should be 430.

If you are confused how I got 430, I added 420 and 10 together because 420 was
the value of 'j' for the fist initial of the first name 'josh' and 10 is the
value of 'j' for the middle name initial.


Answer: I'd suggest to use (`dict` of) `zip` for two lists:

    
    
    from string import lowercase as abc
    
    d1 = dict( zip(abc, [0, 60, 100, 160, ...]) )
    d2 = dict( zip(abc, [1,2,3,4,5,...]) )
    
    ...
    

