Python2 notes

From raju

map with multiple arguments

    Python 2.7.13 |Anaconda 4.3.1 (64-bit)| (default, Dec 19 2016, 13:29:36) [MSC v.1500 64 bit (AMD64)] on win32
    def p(x,y):
        print "x = ", x, ", y = ", y
        
    p(1,2.2)
    x =  1 , y =  2.2
    
    a = map(p, [1.1, 2.2, 3.3], [4.4, 5.5, 6.6])
    x =  1.1 , y =  4.4
    x =  2.2 , y =  5.5
    x =  3.3 , y =  6.6
    
    a = map(p, [1.1, 2.2, 3.3], [4.4, 5.5])
    x =  1.1 , y =  4.4
    x =  2.2 , y =  5.5
    x =  3.3 , y =  None
    
    a = map(p, [1.1, 2.2], [4.4, 5.5, 6.6])
    x =  1.1 , y =  4.4
    x =  2.2 , y =  5.5
    x =  None , y =  6.6