There is a variable of type float in which we introduce the price of the format "RUB. COP." Need to bring in two integer variables, the value of the goods in the form of a whole number of rubles and whole number of cents.

Ie introduced 4.99 and get 4 99.

Until we have code like this. Please tell me how to get the number after the dot?

About the restrictions: no loops and conditional statements

Ie introduced 4.99 and get 4 99.

Until we have code like this. Please tell me how to get the number after the dot?

```
x = float(input())
kop = #help!
rub = int(x)
print(us$, int(kop))
```

About the restrictions: no loops and conditional statements

asked June 14th 19 at 20:04

2 answers

answered on

Solution

```
x = float(input())
rub = int(x // 1)
kop = int(round((x - rub)*100, 2))
print(rub, kop)
```

Under this option, we have the following:

4.99 as 4 99

10.35 10 35

ie seems to be round all the problem numbers as necessary

answered on June 14th 19 at 20:08

```
sum_ = 2.99
ruble = sum_ // 1
kopey = int((sum_ - ruble)*100)
```

Find more questions by tags Python

in this variant will come out 10 34

I have a similar decision myself pile)) - Charit commented on June 14th 19 at 20:11

- Benedict_Shiel commented on June 14th 19 at 20:20

rub, kop = str(4.99).split('.')

print(int(rub), int(kop)) - alexandro_Auer commented on June 14th 19 at 20:23