from operator import div mod class def __init__ self self def __call__

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
from operator import div,mod
class F:
def __init__(self):
self.f=0
def __call__(self,x):
l = int(x[0])+int(x[1])+self.f
self.f = div(l, 10)
return mod(l, 10)
import itertools
print map(F(),itertools.izip("4358","7540"))