{"id":72,"date":"2025-08-03T10:02:14","date_gmt":"2025-08-03T10:02:14","guid":{"rendered":"https:\/\/learn.rantissi.my.id\/?p=72"},"modified":"2025-08-03T10:02:14","modified_gmt":"2025-08-03T10:02:14","slug":"tipe-data-lanjutan-list-tuple-dictionary","status":"publish","type":"post","link":"https:\/\/learn.rantissi.my.id\/index.php\/2025\/08\/03\/tipe-data-lanjutan-list-tuple-dictionary\/","title":{"rendered":"Tipe Data Lanjutan: List, Tuple, Dictionary"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"1-list\">1. List<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Daftar data<\/li>\n\n\n\n<li>Bisa diubah (mutable)<\/li>\n\n\n\n<li>Pakai tanda\u00a0<code>[]<\/code><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>buah = &#91;\"apel\", \"jeruk\", \"mangga\"]\nprint(buah)\nprint(buah&#91;0])    # akses elemen pertama\nbuah.append(\"pisang\")  # menambah elemen\nprint(buah)\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=\"2-tuple\">2. Tuple<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Mirip List, tapi\u00a0<strong>tidak bisa diubah<\/strong>\u00a0(immutable)<\/li>\n\n\n\n<li>Pakai tanda\u00a0<code>()<\/code><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>warna = (\"merah\", \"hijau\", \"biru\")\nprint(warna)\nprint(warna&#91;1])   # akses elemen kedua\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=\"3-dictionary\">3. Dictionary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Data berbentuk pasangan\u00a0<strong>kunci<\/strong>\u00a0dan\u00a0<strong>nilai<\/strong>\u00a0(key-value)<\/li>\n\n\n\n<li>Pakai tanda\u00a0<code>{}<\/code><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>murid = {\n    \"nama\": \"Ran\",\n    \"umur\": 16,\n    \"kelas\": \"XI IPA 2\"\n}\nprint(murid)\nprint(murid&#91;\"nama\"])   # akses nilai berdasarkan key\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"kesimpulan-sederhana\">Kesimpulan Sederhana<\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Tipe Data<\/th><th>Ciri-ciri<\/th><th>Contoh<\/th><\/tr><\/thead><tbody><tr><td>List<\/td><td>Bisa ubah, data berurutan<\/td><td><code>[\"apel\", \"jeruk\"]<\/code><\/td><\/tr><tr><td>Tuple<\/td><td>Tidak bisa ubah, data berurutan<\/td><td><code>(\"merah\", \"hijau\")<\/code><\/td><\/tr><tr><td>Dictionary<\/td><td>Data dengan pasangan kunci-nilai<\/td><td><code>{\"nama\": \"Ran\"}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>1. List 2. Tuple 3. Dictionary Kesimpulan Sederhana Tipe Data Ciri-ciri Contoh List Bisa ubah, data berurutan [&#8220;apel&#8221;, &#8220;jeruk&#8221;] Tuple Tidak bisa ubah, data berurutan (&#8220;merah&#8221;, &#8220;hijau&#8221;) Dictionary Data dengan pasangan kunci-nilai {&#8220;nama&#8221;: &#8220;Ran&#8221;}<\/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-72","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\/72","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=72"}],"version-history":[{"count":1,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":73,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/posts\/72\/revisions\/73"}],"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=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}