I’m working on lists and on exercise:
Python Gradebook
I combined two lists using the following piece of code:
full_gradebook = list(zip(gradebook, last_semester_gradebook))
Where,
last_semester_gradebook = [(“politics”, 80), (“latin”, 96), (“dance”, 97), (“architecture”, 65)]
gradebook = [(‘physics’, 98), (‘calculus’, 97), (‘poetry’, 85), (‘history’, 88), (‘computer science’, 100), (‘visual arts’, 93)]
Now, when I combine both:
full_gradebook = list(zip(gradebook, last_semester_gradebook))
I get the following output:
[((‘physics’, 98), (‘politics’, 80)), ((‘calculus’, 97), (‘latin’, 96)), ((‘poetry’, 85), (‘dance’, 97)), ((‘history’, 88), (‘architecture’, 65))]
Now, how are the items ordered when they are combined? why am I seeing a mix of both lists and not like an append to the existing list?