How can I get dictionary key as variable directly in Python (not by searching from value)? October 11, 2022 by Tarik You should iterate over keys with: for key in mydictionary: print "key: %s , value: %s" % (key, mydictionary[key])