Python

Erik Max Francis max at alcyone.com
Fri Feb 7 04:40:03 EST 2003


Geoff Gerrietts wrote:

> Dynamically typed means something different from what you think it
> does.
> 
>   r = input("r?")
> 
>   # r is now of type string

No, input(x) is equivalent to eval(raw_input(x)), so if a numeric value
was entered at the prompt, r would contain a numeric value.  It sounds
much more likely he's written the equation exactly as written -- with
the ^ operator -- which doesn't work on floats.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ I'll be your strength / I'll be here when you wake up (all right)
\__/ Sweetbox
    7 Sisters Productions / http://www.7sisters.com/
 Web design for the future.




More information about the Python-list mailing list