Re: [Tutor] Finding a nearest perfect cube

2013-11-08 Thread Alan Gauld
On 08/11/13 10:12, Joel Goldstick wrote: inbuilt function or a for loop. Only while and if loops are allowed. This is confusing. What is an 'if loop'? I'm not sure why but this is a common mistake by beginners. I get a lot of emails about my tutorial that refer to "if loops" even though I n

Re: [Tutor] Finding a nearest perfect cube

2013-11-08 Thread Mark Lawrence
On 08/11/2013 10:12, Joel Goldstick wrote: On Fri, Nov 8, 2013 at 4:36 AM, Mark Lawrence wrote: 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. This is conf

Re: [Tutor] Finding a nearest perfect cube

2013-11-08 Thread Joel Goldstick
On Fri, Nov 8, 2013 at 4:36 AM, Mark Lawrence wrote: > 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. This is confusing. What is an 'if loop'? Of c

Re: [Tutor] Finding a nearest perfect cube

2013-11-08 Thread Mark Lawrence
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 a

Re: [Tutor] Finding a nearest perfect cube

2013-11-07 Thread Danny Yoo
> > > 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 > Let's consider those examples. Pretend you were given: input = 4 and the description of the problem. Forget computers for a brief moment. What woul

Re: [Tutor] Finding a nearest perfect cube

2013-11-07 Thread Alan Gauld
On 07/11/13 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

Re: [Tutor] Finding a nearest perfect cube

2013-11-07 Thread Marc Tompkins
On Thu, Nov 7, 2013 at 2:25 PM, 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, outpu

[Tutor] Finding a nearest perfect cube

2013-11-07 Thread donsuni
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 t