LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 October 1 2013

NuclearVision
Member

Python: list(iterable) not working ?

hey guys, i was doing some exercices with python, and i had to create a list of lists.
i tried to map(list, iterable) it failed then i opened idle and it could not compute it. here is what i got:

>>> print list("axiom")

Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    print list("axiom")
TypeError: 'list' object is not callable

Any ideas? im on 2.7.2

edit: i tried codepad.org i got the list as its supposed to for the same input.. its a bug i guess?

Last edited by NuclearVision (October 1 2013)

Offline

#2 October 1 2013

xterm
Moderator

Re: Python: list(iterable) not working ?

>>> list = [] # You probably assigned to 'list', don't do that
>>> print list("axiom")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'list' object is not callable

Offline

#3 October 2 2013

NuclearVision
Member

Re: Python: list(iterable) not working ?

Yeah that's exactly what I have done. I made it to work. Still thanks for help :)

Offline

Board footer