Difference of Numbers
Programming Basics · Python
TASK
Problem
Given `a` and `b`, print `a - b`.
EXAMPLE
Example
10 3
7
LIMITS
Constraints
All integer inputs have absolute value at most 10^9; any additional relationships between them are stated directly in the task.
LEARN
Theory for this problem
+
`input()` reads data entered by the user. The result of `input()` is initially a string. `split()` separates one input line into individual values using spaces. `map()` applies the specified conversion to each input value. The `-` operator subtracts one number from another. `print()` displays the program result. Print only what the problem statement requires.
**Connection to this task.** The `+` and `-` operators perform addition and subtraction. Parentheses make the evaluation order explicit when an expression contains several operations. The expression `a - b` shows how this idea is applied to the task data.
NEED HELP?
Hints
+
['Order matters: compute `a - b`.']
ANSWER
Solution
+
a, b = map(int, input().split()) result = a - b print(result)