[Tutor] getting TypeError: float() argument must be a string or a number

bob gailer bgailer at gmail.com
Sat Apr 27 02:05:48 CEST 2013


On 4/26/2013 6:57 PM, Rajlaxmi Swain wrote:

Welcome to the tutor list. You appear to be a first-time visitor.

To help us help you:

- Tell us:

  - Which version of Python you are using

   - How you are entering and executing your program,

- Provide some of your program (all of it if not too long) as part of 
the email body.

- Include the entire traceback.

Example:

Running Python 3.3.1
Typing in the PyScripter interactive interpreter.

 >>> x = [123]
 >>> print(float(x))
Traceback (most recent call last):
   File "<string>", line 301, in runcode
   File "<interactive input>", line 1, in <module>
TypeError: float() argument must be a string or a number

> How can I fix this.
Examine the argument to float. Ensure it is a string or a number.

-- 
Bob Gailer
919-636-4239
Chapel Hill NC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130426/ceb78949/attachment.html>


More information about the Tutor mailing list