Please tell me how to solve the problem of Kaleidoscopes? Thank you. My attempt⬇️. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please tell me how to solve the problem of Kaleidoscopes? Thank you. My attempt⬇️.

https://code.sololearn.com/c49hBIqSu3kq/?ref=app

1st Jun 2020, 2:19 PM
Тимофей Орловский
11 Answers
+ 2
I'm not sure how it is in c++, but my Python solution worked only when I formatted the output as they said -- always with exactly two decimal places.
1st Jun 2020, 3:11 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
Тимофей Орловский You have to indent line 15
3rd Jun 2020, 1:23 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
Seems to be working alright... Doesn't it pass all the tests?
1st Jun 2020, 2:33 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
Does not pass #5. I tried even negative values.
1st Jun 2020, 2:48 PM
Тимофей Орловский
0
Must be the rounding issue, most likely.
1st Jun 2020, 2:59 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
I tried ceil () and just h even floor () and round () . The number b = 1023 picked up. And the test is hidden, and I can’t understand what the problem is.
1st Jun 2020, 3:04 PM
Тимофей Орловский
0
I formatted using the ceil () function
1st Jun 2020, 3:17 PM
Тимофей Орловский
0
I draw a simple conclusion with the number 1023 without rounding and it gives out what is correct. Without rounding, 4925.74 and 5 are discarded, and with rounding 4925.75.
1st Jun 2020, 4:08 PM
Тимофей Орловский
0
I tried to solve using Python. Please tell me why it displays an error. https://code.sololearn.com/cLI7LvtWWqRb/?ref=app
3rd Jun 2020, 12:48 PM
Тимофей Орловский
0
Everything is equal
3rd Jun 2020, 1:25 PM
Тимофей Орловский
0
Also, you defined a method floor which should use math.floor inside Or you could simply: from math import floor and then just use it without separate definition
3rd Jun 2020, 1:39 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar