Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created September 25, 2020 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/5c413f4ddf6bad8b58b8aa2e5d115d3b to your computer and use it in GitHub Desktop.
Save codecademydev/5c413f4ddf6bad8b58b8aa2e5d115d3b to your computer and use it in GitHub Desktop.
Codecademy export
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