Finding a nearest perfect cube

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Finding a nearest perfect cube

donsuni
This post has NOT been accepted by the mailing list yet.
Hi, I am new to python and i have to write a following code without using any inbuilt function or a for loop. Only while and if loops are allowed.

If i input a number, i should get a perfect cube nearest to it.
For eg: if
input=4, output=8
input=8, output=27
and so on....
can some one help with the code?
Loading...