{"id":105,"date":"2025-08-17T02:08:25","date_gmt":"2025-08-17T02:08:25","guid":{"rendered":"https:\/\/learn.rantissi.my.id\/?p=105"},"modified":"2025-08-17T02:08:26","modified_gmt":"2025-08-17T02:08:26","slug":"list-loop-dictionary-kombinasi","status":"publish","type":"post","link":"https:\/\/learn.rantissi.my.id\/index.php\/2025\/08\/17\/list-loop-dictionary-kombinasi\/","title":{"rendered":"List + Loop + Dictionary (Kombinasi)"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"mengakses-list-dengan-loop\">Mengakses List dengan Loop<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>buah = &#91;\"apel\", \"jeruk\", \"mangga\"]\n\nfor item in buah:\n    print(\"Saya suka\", item)\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"mengakses-dictionary-dengan-loop\">Mengakses Dictionary dengan Loop<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>murid = {\n    \"nama\": \"Ran\",\n    \"kelas\": \"11 IPA\",\n    \"nilai\": 85\n}\n\nfor key in murid:\n    print(key, \":\", murid&#91;key])\n<\/code><\/pre>\n\n\n\n<p>Atau:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for key, value in murid.items():\n    print(key, \"=\", value)\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"list-of-dictionary\">List of Dictionary<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>daftar_murid = &#91;\n    {\"nama\": \"Ran\", \"nilai\": 85},\n    {\"nama\": \"Ali\", \"nilai\": 90},\n    {\"nama\": \"Dina\", \"nilai\": 78}\n]\n\nfor murid in daftar_murid:\n    print(f\"{murid&#91;'nama']} mendapat nilai {murid&#91;'nilai']}\")<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Mengakses List dengan Loop Mengakses Dictionary dengan Loop Atau: List of Dictionary<\/p>\n","protected":false},"author":1,"featured_media":20,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[],"class_list":["post-105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","category-python"],"_links":{"self":[{"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/posts\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/comments?post=105"}],"version-history":[{"count":1,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/posts\/105\/revisions"}],"predecessor-version":[{"id":106,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/posts\/105\/revisions\/106"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/media\/20"}],"wp:attachment":[{"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/media?parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/categories?post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/tags?post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}