0

I am new programmer in python and need help on the block of code from the book Dive into python as given below:

>>> import string
>>> string.join
<function join at 00C55A7C>

This shows no error and I tried the very same in the python interactive shell, and I got the following:

import string
>>> string.join
Traceback (most recent call last):
  File "<pyshell#11>", line 1, in <module>
    string.join
AttributeError: module 'string' has no attribute 'join'

I even copied the text from the book to mine shell,but it still does not help.

What should I do?

Ilja Everilä
  • 50,538
  • 7
  • 126
  • 127
h4kr
  • 238
  • 1
  • 3
  • 13
  • @ erip , you mean string is now called or taken by str? – h4kr Apr 05 '16 at 12:35
  • See [here](http://stackoverflow.com/questions/2026038/relationship-between-string-module-and-str). – erip Apr 05 '16 at 12:37
  • 2
    If you are using Python3, read Dive into Python 3. `string.join` was removed in Python 3. More info in the dupe. – timgeb Apr 05 '16 at 12:37

0 Answers0