A+B: Difference between revisions

Content deleted Content added
Undo revision 87977 by Sparre (Talk) This is not the proper way to get highlighting. Make a highlighting file see [http://rosettacode.org/geshi]
→‎{{header|Python}}: Create Python 2 & 3 version
Line 593: Line 593:
=={{header|Python}}==
=={{header|Python}}==
===Console===
===Console===
<lang python>r = raw_input().split()
<lang python>try: raw_input
except: raw_input = input
print int(r[0]) + int(r[1])</lang>

Alternately:
<lang python>print sum(raw_input().split())</lang>
print(sum(int(x) for x in raw_input().split()))</lang>
In Python 3.x:
<lang python>print(sum(input().split()))</lang>


===File===
===File===