{"id":185,"date":"2021-10-01T09:06:56","date_gmt":"2021-10-01T09:06:56","guid":{"rendered":"https:\/\/ethosspace.com\/programmers\/?p=185"},"modified":"2021-11-10T10:04:31","modified_gmt":"2021-11-10T10:04:31","slug":"python-code-to-print-key-value-in-dictionary-like-maximum-specific-record","status":"publish","type":"post","link":"https:\/\/ethosspace.com\/programmers\/python-code-to-print-key-value-in-dictionary-like-maximum-specific-record\/","title":{"rendered":"Python code to print the key values in dictionary-like maximum, minimum, specific record"},"content":{"rendered":"\n<p>Here is complete running code for python which gives output for printing maximum, minimum from key elements, and associated value. Print complete dictionary. Print specific number record.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>thisdict = {\n  &quot;1&quot;: &quot;C language&quot;,\n  &quot;2&quot;: &quot;Java Language&quot;,\n  &quot;4&quot;: &quot;Python Language&quot;,\n  &quot;3&quot;: &quot;C++&quot;,\n}\nmaxNumber= max(thisdict,key=thisdict.get)\nprint(maxNumber)\nprint(&#39;\\n\\n&#39;)\nminNumber = min(thisdict,key=thisdict.get)\nprint(minNumber)\nprint(&quot;\\n\\n&quot;)\n\n# Print key-value pairs in dictionary whose key is maxNumber\nfor key, value in thisdict.items():\n    if key == maxNumber:\n        print(key, &#39;::&#39;, value)\nprint(&#39;\\n\\n&#39;)\n\n#print complete dictionary\nprint(thisdict)\nprint(&#39;\\n\\n&#39;)\n#print 2nd record from dictionary\n\nn=2\nfor index, (key, value) in enumerate(thisdict.items()):\n    if index == n:\n        print(key, &#39;::&#39;, value)\n        break<\/code><\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>4\r\n\r\n\r\n\r\n1\r\n\r\n\r\n\r\n4 :: Python Language\r\n\r\n\r\n\r\n{'1': 'C language', '2': 'Java Language', '4': 'Python Language', '3': 'C++'}\r\n\r\n\r\n\r\n4 :: Python Language<\/code><\/pre>\n\n\n\n<p>To python code online refer <a href=\"https:\/\/ethosspace.com\/programmers\/free-online-python-compiler-interpreter\/\" title=\"Free Online Python Compiler (Interpreter)\">free online compiler.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is complete running code for python which gives output for printing maximum, minimum from key elements, and associated value. Print complete dictionary. Print specific number record. Output To python code online refer free online compiler.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[11],"tags":[],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-running-code-and-program"],"aioseo_notices":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"sparkling-featured":false,"sparkling-featured-fullwidth":false,"tab-small":false},"uagb_author_info":{"display_name":"program45_-rt8nb","author_link":"https:\/\/ethosspace.com\/programmers\/author\/program45_-rt8nb\/"},"uagb_comment_info":0,"uagb_excerpt":"Here is complete running code for python which gives output for printing maximum, minimum from key elements, and associated value. Print complete dictionary. Print specific number record. Output To python code online refer free online compiler.","_links":{"self":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":5,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"predecessor-version":[{"id":957,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/185\/revisions\/957"}],"wp:attachment":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}