0

Python AttributeError: 'tuple' object has no attribute 'append'

last_semester_gradebook = [["politics", 80], ["latin", 96], ["dance", 97], ["architecture", 65]] # Your code below: subjects = ["physics", "calculus", "poetry", "history"] gardes = [98, 97, 85, 88] gradebook = [["physics", 98], ["calculus", 97], ["poetry", 85]], ["history", 88] print(gradebook) gradebook.append(["computer science", 100])

4th Apr 2021, 7:46 AM
Chauncey PC
Chauncey PC - avatar
2 Antworten
+ 3
gradebook = [ ["physics", 98], ["calculus", 97], ["poetry", 85], ["history", 88] ] Misplaced of ']' in the definition of <gradebook> list.
4th Apr 2021, 8:10 AM
Ipang
0
My guess is try using a list instead of a tuple. I think tuples don't have methods like that because they're immutable.
4th Apr 2021, 8:06 AM
CamelBeatsSnake
CamelBeatsSnake - avatar