Skip to content

Add two numbers you were given

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.

Log in or create account

IGCSE, A-Level & AP