I have a simple if-else that takes a command-line argument and returns a value from a dictionary. When I enter 'Darth Vader', it returns 'Luke, I am your None' instead of 'No, I am your father'.
It works as expected with all other keys in the dictionary. Here is the code:
import sys
relations = {'Darth Vader': 'father', 'Leia': 'sister', 'Han': 'brother in law',
'R2D2': 'droid', 'Rey': 'Padawan', 'Tatooine': 'homeworld'}
key = sys.argv[1]
if key == 'Darth Vader':
print("No, I am your father")
else:
print('Luke, I am your', relations.get(key))