Created
February 11, 2021 00:30
-
-
Save rdapaz/1c7db6ee1e9b88da4a3fdc685ca2a850 to your computer and use it in GitHub Desktop.
Clever data munging with hashes
This file contains hidden or 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
abbrevs = [ | |
'STP', | |
'TCP', | |
'TI', | |
'USB', | |
'UTP', | |
'VLAN', | |
'VLANs', | |
'VM', | |
'VMs', | |
'VPN', | |
] | |
defns = """ | |
ACL|Access Control List | |
BIA|Business Impact Assessment | |
BoD|Basis of Design | |
""".splitlines() | |
defns = {x:y for x, y in [r.split('|') for r in defns if len(r) > 0]} | |
y = {x: defns.get(x, '') for x in abbrevs} | |
for k, v in y.items(): | |
print(k, v, sep="|") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment