[Tutor] Finding a nearest perfect cube
Mark Lawrence
breamoreboy at yahoo.co.uk
Fri Nov 8 10:36:14 CET 2013
On 07/11/2013 22:25, donsuni wrote:
> 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?
>
Impossible as stated above, how do you get input without using an
inbuilt function? I'd also like to see you write an if loop.
--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer
Mark Lawrence
More information about the Tutor
mailing list