This one doesn't work for every value I input......please tell me how to rectify ......like if I input 2 there is no output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

This one doesn't work for every value I input......please tell me how to rectify ......like if I input 2 there is no output

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

12th Dec 2019, 5:36 PM
Aarav Sharma
Aarav Sharma - avatar
5 Answers
+ 3
Aarav Sharma, you have posted the same question twice, this is not even what makes things better. I have also answered you in the other post. https://www.sololearn.com/Discuss/2100385/?ref=app If I use the input number 2.1234 with your x increment of 0.0001 the expression "if(math.isclose(round(10**x,4),a)):" will not match and run probably infinite. When using a different and smaller increment of 0.0000001 the result will presented. This is after a relatively long computation time. My recommendation is, that you study the python docs about the function isclose(), and also take in account the tolerances of this function, which are set for default, as you have not set them yourself.
15th Dec 2019, 2:13 PM
Lothar
Lothar - avatar
+ 1
Please help if u can
13th Dec 2019, 6:37 AM
Aarav Sharma
Aarav Sharma - avatar
+ 1
But there's no output
13th Dec 2019, 6:41 AM
Aarav Sharma
Aarav Sharma - avatar
+ 1
Expected output for 2 must be 0.3
13th Dec 2019, 6:42 AM
Aarav Sharma
Aarav Sharma - avatar
0
There are many..........2,4,4.123,1,5 and many more........ It's giving me the accurate output for the input"10 or 1000"
13th Dec 2019, 6:55 AM
Aarav Sharma
Aarav Sharma - avatar