Skip to content

Instantly share code, notes, and snippets.

@sometowngeek
Created February 24, 2018 18:20
Show Gist options
  • Save sometowngeek/4fe23ea4bbdc8017fb764a1fcb77d804 to your computer and use it in GitHub Desktop.
Save sometowngeek/4fe23ea4bbdc8017fb764a1fcb77d804 to your computer and use it in GitHub Desktop.
# Create a dictionary with one key-value pair
d = dict()
d["ABS"] = "Anti-lock Braking System"
# The previous block could be simplified to:
# d = {"ABS": "Anti-lock Braking System"}
# Get input from user
s = input("Enter something: ")
# Print user's input in upper case
print(s.upper())
# Print the value from the dictionary
print(d[s.upper()])
Connected to pydev debugger (build 172.3968.37)
Enter something: abs
ABS
Anti-lock Braking System
Process finished with exit code 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment