Mar-28-2020, 10:07 AM
You want to do
one would be
if month in monthConversions: print(monthConversions[month]) else: print("Wrong Value ")however,there is more pythonic ways to do it
one would be
try: print(monthConversions[month]) except KeyError: print("Wrong Value")the best would be
print(monthConversions.get(month, "Wrong Value"))
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs