I would like to print a specific Python dictionary key:
mydic = {}
mydic[\'key_name\'] = \'value_name\'
Now I can check if mydic.has_
Hmm, I think that what you might be wanting to do is print all the keys in the dictionary and their respective values?
If so you want the following:
for key in mydic:
print "the key name is" + key + "and its value is" + mydic[key]
Make sure you use +'s instead of ,' as well. The comma will put each of those items on a separate line I think, where as plus will put them on the same line.
The name of the key 'key_name' is key_name, therefore print 'key_name'
or whatever variable you have representing it.