Hi,<br><br>I'm a newbie with python and I recently bought Beginning with Python (Which is a book I recommend) but the problem that I'm facing it's the following:<br><br><b>This is the code:<br></b><br>#!/usr/bin/python2.5<br>
# Filename: str_format.py<br><br>age = 25<br>name = 'foobar'<br><br>print('{0} is {1} years old'.format(name, age))<br>print('Why is {0} playing with that python?'.format(name))<br><br><br><b>But when I run the script I receive this error:<br>
<br></b>Traceback (most recent call last):<br> File "str_format.py", line 7, in <module><br> print('{0} is {1} years old'.format(name, age))<br>AttributeError: 'str' object has no attribute 'format'<br>
<br><br>It is an error because of the version that I'm using ? Python 2.5.2 (Debian lenny)<br><br>Thanks in advance.<br><br><br><br>