Created
July 14, 2021 02:49
-
-
Save XDo0/d771cb8d17a4889af3004f1327f55746 to your computer and use it in GitHub Desktop.
Add to 2-D dict Python
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
def addtwodimdict(thedict, key_a, key_b, val): | |
if key_a in adic: | |
thedict[key_a].update({key_b: val}) | |
else: | |
thedict.update({key_a:{key_b: val}}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment