Created
February 24, 2018 18:20
-
-
Save sometowngeek/4fe23ea4bbdc8017fb764a1fcb77d804 to your computer and use it in GitHub Desktop.
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
# 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()]) |
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
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