Python 3 Gradebook Type Error

Hi, I’m just finishing up the Python 3 gradebook project and I’m stuck on the last part. https://www.codecademy.com/courses/learn-python-3/projects/gradebook

Here’s the question:

You also have your grades from last semester, stored in last_semester_gradebook . Create a new variable full_gradebook with the items from both gradebook and last_semester_gradebook .

Here’s my code for the whole thing:
last_semester_gradebook = [(“politics”, 80), (“latin”, 96), (“dance”, 97), (“architecture”, 65)]
subjects = [“physics”,“calculus”,“poetry”,“history”]
grades = [98,97,85,88]
subjects.append(“computer science”)
grades.append(100)
subjects.append(“visual arts”)
grades.append(100)
gradebook = zip(subjects, grades)
print(list(gradebook))
full_gradebook = gradebook + last_semester_gradebook

When I run it I get this error:
Traceback (most recent call last):
** File “script.py”, line 10, in **
** full_gradebook = gradebook + last_semester_gradebook**
TypeError: unsupported operand type(s) for +: ‘zip’ and 'list’

I don’t quite understand what’s happening. I was doing exactly what the hint in the last question was telling me! Could someone help me out please? Thanks so much! :robot:

When you zip(subjects, grade), you don’t actually convert it to a list. You only print the list value; it isn’t saved anywhere. You can’t join using + a list object and a zip object.

1 Like

Thank you SO MUCH! It was driving me crazy!

1 Like