On 6/14/2014 2:17 PM, sandhyaranimangip...@gmail.com wrote:
I am new to python, pls help me to resolve the below error
Please read the nice tutorial, though no necessarily all at once. It
explains things like this.
def fib(n):
... """Print a Fibonacci series up to n."""
File "", line 2
On Saturday, June 14, 2014 11:17:50 AM UTC-7, sandhyaran...@gmail.com wrote:
> I am new to python, pls help me to resolve the below error
>
>
>
>
>
> >>> def fib(n):
>
> ... """Print a Fibonacci series up to n."""
>
> File "", line 2
>
> """Print a Fibonacci series up to n."""
>
>
I am new to python, pls help me to resolve the below error
>>> def fib(n):
... """Print a Fibonacci series up to n."""
File "", line 2
"""Print a Fibonacci series up to n."""
^
IndentationError: expected an indented block
--
https://mail.python.org
On Jul 21, 12:56 am, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> On Jul 19, 12:20 am, John Machin <[EMAIL PROTECTED]> wrote:
>
> > On Jul 19, 8:05 am, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> > > for more information. But I'm guessing that you're
> > > questioning the fact that a value that's a
On Jul 19, 12:20 am, John Machin <[EMAIL PROTECTED]> wrote:
> On Jul 19, 8:05 am, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> > for more information. But I'm guessing that you're
> > questioning the fact that a value that's apparently
> > *less* than 3499.35 is rounded up to 3499.4, rather
> > tha
On Jul 19, 8:05 am, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> On Jul 18, 10:17 pm, Anthony <[EMAIL PROTECTED]> wrote:
>
> > Isn't this a mistake???
>
> Which 'this'? That is, what were you expecting?
>
> If you're objecting to the fact that the second result
> produces 3499.34999 instead
On Jul 18, 11:15 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> No, round() return binary floats that, in general, cannot represent
> decimal floats exactly. Formatted printing gives what you expect.
> >>> '%8.2f' % x
> ' 3499.35'
Sure. But it's still true that the second printed value
(printed a
Anthony wrote:
Isn't this a mistake???
round(3499.349439034,44)
3499.3494390340002
round(_,2)
3499.34999
round(_,1)
3499.40001
My Python 2.5.1 spat that out..
No, round() return binary floats that, in general, cannot represent
decimal floats exactly. Formatted printi
On Jul 18, 10:17 pm, Anthony <[EMAIL PROTECTED]> wrote:
> Isn't this a mistake???
Which 'this'? That is, what were you expecting?
If you're objecting to the fact that the second result
produces 3499.34999 instead of 3499.35, then
no, that's not a mistake; see
http://www.python.org/doc/
Isn't this a mistake???
>>> round(3499.349439034,44)
3499.3494390340002
>>> round(_,2)
3499.34999
>>> round(_,1)
3499.40001
My Python 2.5.1 spat that out..
--
http://mail.python.org/mailman/listinfo/python-list
On May 14, 11:40 am, globalrev <[EMAIL PROTECTED]> wrote:
> so just a mistake on his part? but it looks like he just copied his
> shell...has there been a change since 2004 inr egards to how you can
> pass functions as arguments to functions??
Adding the value argument (x) to the compose function
globalrev wrote:
but it looks like he just copied his
shell...has there been a change since 2004 inr egards to how you can
pass functions as arguments to functions??
It looks like it's copy/pasted from a shell, but it's not. No past or
present Python interpreter could produce an interactive s
http://linuxgazette.net/109/pramode.html
>>>
>>>def sqr(x): return x*x
...
>>>def cube(x): return x*x*x
...
>>>sqr
>>>a = [sqr, cube]
>>>a[0](2)
>>>def compose(f, g): return f(g(x))
...
>>>compose(sqr, cube, 2)
64
>>>
but i get:
>>> compose(sqr, cube, 2)
Traceback (most recent call last):
F
13 matches
Mail list logo