Danish a positive valid number X. Display its first digit after the decimal point.
x = float (input ()) Print (int (x * 10)% 10)
Explain why you need to use the number 10 in the equation where we took it, thank you in advance. Is it possible to some other way to solve this task?
Answer 1, Authority 100%
We use a decimal number system.
Multiplication of the top ten translates the first to the digit after the point in the discharge of units.
123.4 * 10 = 1234
Taking the residue from division by module 10 leaves only the discharge of units.
1234% 10 = 4
In the end, you find what you were looking for.
can be solved in many ways, but this, the cavity, the most logical.
Answer 2, Authority 50%
From there that we use the decimal number of the number of numbers. Do computations on a piece of paper and everything will become clear.
can be solved in another way, yes. And not even one.