+ 1

why dictionary not working?in phython

i want to take input from user and on this input i want to print one number from dictionary but its not working https://code.sololearn.com/cBNFFV0IC0zq/?ref=app

4th Aug 2020, 3:32 PM
Aayush Jat
Aayush Jat - avatar
1 Réponse
+ 18
That's because you take 2 times input and the second was hi[input()] #input take as string For solution you can make variable for input, like inp = int(input()) And refer to inp variable #if inp>28: #print(hi[inp])
4th Aug 2020, 3:39 PM
᮴Ridwan_
᮴Ridwan_ - avatar