def normalize(name): return name[0].upper() + name[1:].lower()
from functools import reduce def prod(L): def c(x,y): return x*y return reduce(c,L)
import math from functools import reduce def str2float(s): if( s.find('.') > -1 ): point = s.index('.') s = s.replace('.','') else: point = 0 def str2int(s): return {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9 }[s] def c(x,y): return x * 10 + y return reduce( c, map( str2int , s ) ) / int( math.pow( 10,point ) )
Sign in to make a reply
rrke