Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

return key from value dictionary python

cars = {'ford': 10, 'opel': 5 }

def get_val(key):
    return cars[key]

ford = get_val('ford')
print(ford)
Source by note.nkmk.me #
 
PREVIOUS NEXT
Tagged: #return #key #dictionary #python
ADD COMMENT
Topic
Name
3+9 =