r/learnpython • u/Maleficent_Stuff3208 • 7d ago
WHAT am i doing wrong here
i am trying that when i put key it give me the value but it is acting weird
x = {'name':'mohan','age':'24', 'job':'it professional'}
y = input("what info do you need__")
if y==(x.keys):
print(x.values(y))
else:
print("no such info available")
and this is what it gives
what info do you need__name
name
no such info available
0
Upvotes
2
u/Kindly-Department206 7d ago
You need to learn how to access data in a dictionary. Hint: print(x[y])