May-31-2020, 05:54 AM
(May-31-2020, 05:48 AM)buran Wrote:Thanks. This solution is more intuitive and it worked.input
returnsstr
and the values in the dict areint
, so the user input and [any] value from the dict will never be equal.
Do you really want to print 'not found' for each not equal value? Also there are better ways to iterate over dict:
for key, value in dict.items(): # do something with key and value