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