pyPython Practice LabFrom first print to final round
PYTHON PROBLEM 003 · Starter

Add two integers

A shop combines quantities from two small orders.

integers · arithmeticintegersarithmetic
PROBLEM OVERVIEW

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.

INPUT FORMAT

Program input

Two integers, one per line.

VERIFIED SAMPLE CASES

Input and expected output

Normal case

A shop combines quantities from two small orders.

Sample input
12
8
Expected output
20

Why: split() separates the two tokens, map(int, ...) converts them, and + adds them.

Boundary or variation

A ledger combines a credit and a negative correction.

Sample input
25
-9
Expected output
16

Why: split() separates the two tokens, map(int, ...) converts them, and + adds them.

PYTHON SOLUTION

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.

READY TO PRACTISE?

Open the guided learning workspace

Trace the logic and reveal the line-by-line explanation. The browser compiler unlocks with complete access.

Open problem 3
SKILL TO CARRY FORWARD

Pattern relevance

This exercise strengthens integers · arithmetic. Be ready to explain the input, the rule, the boundary cases, and why the chosen approach is appropriate.