Aug-30-2021, 05:12 PM
(This post was last modified: Aug-30-2021, 05:23 PM by Yoriz.
Edit Reason: Added code tags
)
Just starting with Python, but have worked with several programming languages over the years. I always prefer explicit typing, but maybe Python will convince me otherwise. I'm taking a course on AI programming and the class is using Python so I am picking it up as the class goes along. I am running into a problem here that I just know is very basic and that I am missing something obvious and most likely stupid. Anyone help me understand why I keep getting this error? Here is the code I have parsed down to the most basic to show the error. The code below was run in IDLE and I can't figure out why it won't print the first item in the list and instead throws this exception. Thanks in advance
>>> x = list['6048922', '334318'] >>> print(x) list['6048922', '334318'] >>> print(x[0]) Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> print(x[0]) TypeError: There are no type variables left in list['6048922', '334318']