pls help. beginner question.

+1 Marco Alexis · August 17, 2015
I'm just starting to watch the tutorials and after every episode I tried each topic, but when I came in lists topic, it gives me error

>>> players[:3] = []
Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    players[:3] = []
TypeError: 'tuple' object does not support item assignment

>>> players.append[11]
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'append'

What have I done wrong?

Post a Reply


- page 2
Oldest  Newest  Rating
0 Halcyon Abraham Ramirez · August 21, 2015
In your 1st example your print statement was inside the for loop. Hence it printed start everytime it was incremented. on the second example you pronted start after the for loop thats why you only had one result 
0 Marco Alexis · August 21, 2015
Thanks mate. I've also read from online courses the value of indentation in code blocks. :)
0 chikki bhargava · September 12, 2015
you were using wrong box (), i guess like players.append( ) this is right format
  • 1
  • 2



This section is all about snakes! Just kidding.

Bucky Roberts Administrator