Do you need help?

Notice Board

Per partecipare al corso di Fondamenti di programmazione 2021-22 loggatevi e attivatelo nella vostra pagina dei corsi preferiti. A quel punto il corso appare nel menĂ¹ personale cliccando sul proprio avatar. Per i materiali degli anni precedenti seguite lo stesso metodo.

To join the Programming/Lab 2021-22 course, log-on and select it on the my courses page. It will appear on the personal menu of your avatar. For earlier years use the same method.

VIDEOLEZIONI DEL CORSO DI FONDAMENTI DI PROGRAMMAZIONE AA20-21

PROGRAMMING COURSE VIDEOCONFERENCES AY20-21

Transform a string in a List

leonardo_13 (1540 points)
6 14 22
in Exam exercises by (1.5k points)
reshown by
Why if I write these lines of code it give me back "TypeError: 'dict_items' object is not callable" and not " ['w', 'o', 'r', 'd'] " ?

If I use python directly on the prompt it works.

word = "word"
list_of_letters = list(word)
print(list_of_letters)
97 views
closed

2 Answers

Best answer
SaverioPas (710 points)
1 4 6
by (710 points)
selected by
I've just tried it and it works for me...
SaverioPas (710 points)
1 4 6
by (710 points)
Maybe the problem is not in those lines, it says "dict_items", so there should be a dictionary somewhere that you called instead of a string
leonardo_13 (1540 points)
6 14 22
by (1.5k points)
I'll try to uninstall and install again Spyder
angelo.spognardi (4720 points)
37 65 99
by (4.7k points)
You've likely defined a variable called list, hiding the original list function.

A.
leonardo_13 (1540 points)
6 14 22
by (1.5k points)
thank you professor