+ 2
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.



