Geoff Gerrietts geoff at
Fri Feb 7 04:43:09 CET 2003

Quoting Uri (phrogeeb at
> My problem is that r is a percentage (in my program, I tell the user
> to represent 4% as .04).  When I run the program, it says that there's
> no way to deal with a double or something to that effect. But I also
> read that there's no way to type a variable, that they are
> "dynamically typed". Well, that doesn't work here.
> So, what do I do?

Dynamically typed means something different from what you think it

  r = input("r?")

  # r is now of type string
  r = float(r)

  # r is now of type float

That's what you want to do. :)


Geoff Gerrietts             "A little sincerity is a dangerous thing, 
geoff @        and a great deal of it is absolutely fatal."                           --Oscar Wilde

More information about the Python-list mailing list