D
D
Dima2021-06-10 19:04:37
Python
Dima, 2021-06-10 19:04:37

How to convert a variable to a number and make it pop up a number without zeros?

60c23807af4c3659539672.png

How to do it right please tell me

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2021-06-10
@interneterrorhehe

Yes, at least it's possible:

number = int(input('Максимальное количество отжиманий'))
find1, find2, find3 = number*0.4, number*0.7, number*0.9
print(f'Ваша схема: {find1:.0f} {find2:.0f} {find3:.0f}')

if this is the whole program

P
Petr Lesopovalov, 2021-06-10
@Petr_axeman

Here the question is, if you need to write int(number * 0.3) without zeros after the decimal point, and not int numer * 3.
If there are no zeros at all, then I suppose you need to turn it into a string and simply delete the oulie using the .replace() method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question