+ 1
[Solved] Why is there an error, and how do I fix it?
skills_list_1 = ["Lightning","Mind Control","Telekinesis","Mind Reading","Super Speed"] magic_skill_1 = skills_list_1(2) print(magic_skill_1) It says "list" object could not be called, why?
1 Antwort
+ 6
If you want to get an element of a list, you enclose the index with [] instead of ()
In this case that line 2 should be changed to:
magic_skill_1 = skill_list_1[2]
The error message happens because a list object isn't callable. An example of a callable object is a function, which you know because you use () to provide parameters.