Skip to content

Instantly share code, notes, and snippets.

@crystalattice
Created April 2, 2018 00:33
Show Gist options
  • Save crystalattice/36669a4dbadd69f30846dad1aa3f1377 to your computer and use it in GitHub Desktop.
Save crystalattice/36669a4dbadd69f30846dad1aa3f1377 to your computer and use it in GitHub Desktop.
hardness_scale = {"talc": 1, "gypsum": 3, "calcite": 9}
minerals = {}
for a_key in hardness_scale.keys():
minerals[a_key] = hardness_scale[a_key]
print(minerals) #{'talc': 1, 'gypsum': 3, 'calcite': 9}
for a_key in hardness_scale:
minerals[a_key] = hardness_scale[a_key]
print(minerals) #{'talc': 1, 'gypsum': 3, 'calcite': 9}
minerals = hardness_scale.copy()
print(minerals) #{'talc': 1, 'gypsum': 3, 'calcite': 9}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment