[Tutor] something is fundamentally wrong...

Joshua Nikkel nosh3141 at gmail.com
Sat Aug 9 17:45:04 CEST 2008


I've pasted the following from my python shell.  Please note that the first
two lines of code are taken directly from the standard tutorial files under
section 3.1.2.  Will someone please tell me why something as basic and
straightforward as this will not work?  Everything else seems to work just
fine, but not this.  All I need is someway to get the length of a string...

please help,

nosh


Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
on win32
Type "copyright", "credits" or "license()" for more information.

    ****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface.  This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************

IDLE 1.2.2      ==== No Subprocess ====
>>> s = 'supercalifragilisticexpialidocious'
>>> len(s)
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    len(s)
TypeError: 'str' object is not callable
>>> s
'supercalifragilisticexpialidocious'
>>> len(s)
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    len(s)
TypeError: 'str' object is not callable
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080809/6c2a9d46/attachment-0001.htm>


More information about the Tutor mailing list