Add two numbers you were given
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
This one builds on a lesson you haven't finished yet. Do that lesson first:
Python Basics · Getting input →
Add two numbers you were given
Read two whole numbers, one per line, and print their total. For 3 and 4, print 7.
Two reads, two int(...), then one +. Forget one int and you get 34 instead of 7 — Python joined the text rather than adding the numbers.
Read two whole numbers, one per line, and print their total. For 3 and 4, print 7.
Click Run to see the output here.