a +b ?
superpollo
utente at esempio.net
Fri Jun 11 10:19:31 EDT 2010
yanhua ha scritto:
> hi,all£¡
> it's a simple question:
> input two integers A and B in a line,output A+B?
>
> this is my program:
> s = input()
this does not work
> t = s.split()
> a = int(t[0])
> b = int(t[1])
> print(a+b)
>
> but i think it's too complex,can anybody tell to slove it with less code.
>>> import operator
>>> print reduce(operator.add, map(int, raw_input().split()))
124312 41242
165554
>>>
bye
More information about the Python-list
mailing list