-
-
Save codecademydev/c35a915104993835ae160b1863af5cf5 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
last_semester_gradebook = [("politics", 80), ("latin", 96), ("dance", 97), ("architecture", 65)] | |
# STEP 1: Create a list called subjects and fill it with the classes you are taking: | |
subjects = ["physics", "calculus", "poetry", "history"] | |
# STEP 2: Create a list called grades and fill it with your scores: | |
grades = [98, 97, 85, 88] | |
# STEP 5: After your definitions of subjects and grades but before you create gradebook, use append to add "computer science" to subjects and 100 to grades. | |
subjects.append("computer science") | |
grades.append(100) | |
# STEP 3 & 4: Use the zip() function to combine subjects and grades and print the result | |
gradebook = list(zip(subjects, grades)) | |
# STEP 6: After the creation of gradebook (but before you print it out), use append to add ("visual arts", 93) to gradebook. | |
gradebook.append(("viusal arts", 93)) | |
print(gradebook) | |
# STEP 7: Creating the variable to gather all the grades from last semester | |
full_gradebook = gradebook + last_semester_gradebook | |
print(full_gradebook) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment