What this Python exercise asks you to practise
This scenario tests add two integers. It belongs to the Python Foundations roadmap and uses the integers · arithmetic pattern.
Programs, values, variables, input(), print(), and basic type conversion.
Program input
Two integers, one per line.
Input and expected output
A shop combines quantities from two small orders.
12
820Why: split() separates the two tokens, map(int, ...) converts them, and + adds them.
A ledger combines a credit and a negative correction.
25
-916Why: split() separates the two tokens, map(int, ...) converts them, and + adds them.
Reference answer with explanation
first = int(input())
second = int(input())
print(first + second)Read one number per line, convert each text value with int(), then add the two numbers.
Common beginner check: Forgetting that input() returns text, even when the user types a number.
Open the guided learning workspace
Trace the logic and reveal the line-by-line explanation. The browser compiler unlocks with complete access.
Open problem 3Pattern relevance
This exercise strengthens integers · arithmetic. Be ready to explain the input, the rule, the boundary cases, and why the chosen approach is appropriate.