{"id":149,"date":"2025-08-17T23:35:06","date_gmt":"2025-08-17T23:35:06","guid":{"rendered":"https:\/\/learn.rantissi.my.id\/?p=149"},"modified":"2025-08-17T23:35:08","modified_gmt":"2025-08-17T23:35:08","slug":"oop-lanjutan-list-of-object-mini-project","status":"publish","type":"post","link":"https:\/\/learn.rantissi.my.id\/index.php\/2025\/08\/17\/oop-lanjutan-list-of-object-mini-project\/","title":{"rendered":"OOP Lanjutan + List of Object + Mini Project"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Class Mahasiswa (versi lanjut)<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>class Mahasiswa:\n    def __init__(self, nama, nim, prodi):\n        self.nama = nama\n        self.nim = nim\n        self.prodi = prodi\n\n    def info(self):\n        print(f\"Nama: {self.nama}\")\n        print(f\"NIM: {self.nim}\")\n        print(f\"Prodi: {self.prodi}\")\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\">List of Object<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>mhs1 = Mahasiswa(\"Ran\", \"123\", \"Informatika\")\nmhs2 = Mahasiswa(\"Ali\", \"124\", \"Sistem Informasi\")\nmhs3 = Mahasiswa(\"Dina\", \"125\", \"Teknik Komputer\")\n\ndaftar_mhs = &#91;mhs1, mhs2, mhs3]\n\nfor mhs in daftar_mhs:\n    mhs.info()\n    print(\"---------\")\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\">Mini Project: Sistem Data Mahasiswa Sederhana<\/h2>\n\n\n\n<p>Fitur:<br>\u2705 Input banyak mahasiswa<br>\u2705 Simpan sebagai object<br>\u2705 Tampilkan semua data<br>\u2705 Cari mahasiswa berdasarkan NIM<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Template Kode:<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>class Mahasiswa:\n    def __init__(self, nama, nim, prodi):\n        self.nama = nama\n        self.nim = nim\n        self.prodi = prodi\n\n    def info(self):\n        print(f\"Nama: {self.nama}\")\n        print(f\"NIM: {self.nim}\")\n        print(f\"Prodi: {self.prodi}\")\n\ndaftar_mhs = &#91;]\n\njumlah = int(input(\"Berapa banyak mahasiswa? \"))\n\nfor i in range(jumlah):\n    print(f\"\\nData Mahasiswa ke-{i+1}\")\n    nama = input(\"Nama: \")\n    nim = input(\"NIM: \")\n    prodi = input(\"Prodi: \")\n    daftar_mhs.append(Mahasiswa(nama, nim, prodi))\n\nprint(\"\\n--- Data Mahasiswa ---\")\nfor mhs in daftar_mhs:\n    mhs.info()\n    print(\"---------\")\n\n# Cari berdasarkan NIM\ncari = input(\"Masukkan NIM untuk dicari: \")\nketemu = False\nfor mhs in daftar_mhs:\n    if mhs.nim == cari:\n        print(\"\\nData ditemukan:\")\n        mhs.info()\n        ketemu = True\n        break\n\nif not ketemu:\n    print(\"Data tidak ditemukan.\")<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Class Mahasiswa (versi lanjut) List of Object Mini Project: Sistem Data Mahasiswa Sederhana Fitur:\u2705 Input banyak mahasiswa\u2705 Simpan sebagai object\u2705 Tampilkan semua data\u2705 Cari mahasiswa berdasarkan NIM Template Kode:<\/p>\n","protected":false},"author":1,"featured_media":20,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,9,7],"tags":[],"class_list":["post-149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","category-projek","category-python"],"_links":{"self":[{"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/posts\/149","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=149"}],"version-history":[{"count":1,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":150,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/posts\/149\/revisions\/150"}],"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=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/categories?post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learn.rantissi.my.id\/index.php\/wp-json\/wp\/v2\/tags?post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}