Number of Tens
Programming Basics · Python
TASK
Problem
Given non-negative integer `n`, print the number of complete tens.
EXAMPLE
Example
347
34
LIMITS
Constraints
Quantities, prices, and balances are integers from 0 to 10^9; other integer inputs have absolute value at most 10^9.
LEARN
Theory for this problem
+
`input()` reads data entered by the user. The result of `input()` is initially a string. `int()` converts a numeric string into an integer. The `//` operator performs integer division and keeps the whole-number part. `print()` displays the program result. Print only what the problem statement requires.
**Connection to this task.** The `//` operator performs floor integer division. It is useful for counting how many complete groups of a fixed size fit into a value. The expression `n // 10` shows how this idea is applied to the task data.
NEED HELP?
Hints
+
['Complete tens are `n // 10`.']
ANSWER
Solution
+
n = int(input()) result = n // 10 print(result)