Last active
March 11, 2021 04:57
-
-
Save studiawan/6632475 to your computer and use it in GitHub Desktop.
Python dictionary
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
# declare dictionary | |
banner = {} | |
# fill dictionary | |
banner['os'] = 'Ubuntu Server 13.04' | |
banner['server'] = 'ProFTPd 1.3.4' | |
banner['up'] = 315.5 | |
banner[200] = 'OK' | |
print(banner) | |
# iterate through dictionary | |
for key, value in banner.items(): | |
print(key, value) | |
# delete item based on key | |
del banner['up'] | |
print(banner) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment