[docs] Tutorial problem

Joe McDonald jam at massa.com
Tue Feb 1 17:28:41 CET 2011


Hello,

 

I don't know if I'm emailing the right place, but in the Python Tutorial
2.7.1 by Guido van Rossum, Chapter 7, I tried the examples on the
interpreter and got:

 

>>> print 'This {food} is {adjective}.'.format(food='spam',
adjective='absolutely horrible')

 

Traceback (most recent call last):

  File "<pyshell#20>", line 1, in -toplevel-

    print 'This {food} is {adjective}.'.format(food='spam',
adjective='absolutely horrible')

AttributeError: 'str' object has no attribute 'format'

 

Other examples from this chapter gave similar results. Am I missing
something? I had tried "import string", but that didn't affect the result.

 

Joe McDonald

 







This email message, including any attachments, may contain company confidential and proprietary
information for the sole use of the intended  recipient.  If you are not the intended 
recipient, you are hereby notified that any use, copying or dissemination of this message 
is strictly prohibited.
 
If you received this message in error, please notify Massa Products Corporation immediately 
by reply email or by calling Massa Products Corporation at 800-962-7543. Then delete this 
message from your system, without making any copy or distribution. 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20110201/ba081572/attachment-0001.html>


More information about the docs mailing list