0

Не могу ввести число с плавающей точкой (0.01).В чем дело?

Текст программы: pm = input('->') payment02 = float(pm) print(payment02) sum02 = 0 i = 1 while i <= 30: sum02 += payment02 * 2 ** (i - 1) i += 1 print(round(sum02,2)) Мое решение задания из: Python Core/Basic Concepts/Exponentiation После команды RUN выдает ошибку:ValueError: could not convert string to float: ''

17th Mar 2021, 10:03 PM
Val
Val - avatar
5 Answers
0
I've solved the problem this way : b = 0.01*(2**30) print(b)
18th Mar 2021, 3:10 PM
Ervis Meta
Ervis Meta - avatar
0
Looks like it works to me. What is it doing wrong?
17th Mar 2021, 10:21 PM
Jerry Hobby
Jerry Hobby - avatar
0
My task solution from: Python Core / Basic Concepts / Exponentiation After the RUN command, it gives an error: ValueError: could not convert string to float: ''
18th Mar 2021, 9:15 AM
Val
Val - avatar
0
Thanks. I didn't understand the problem condition. # место для вашего кода payment = 0.01 i = 30 pdi = payment * 2 ** i print(pdi)
18th Mar 2021, 9:47 PM
Val
Val - avatar
0
No problem 😄
18th Mar 2021, 9:48 PM
Ervis Meta
Ervis Meta - avatar