{"id":12429,"date":"2023-05-08T10:53:10","date_gmt":"2023-05-08T10:53:10","guid":{"rendered":"https:\/\/www.webhozz.com\/blog\/?p=12429"},"modified":"2023-05-11T06:32:17","modified_gmt":"2023-05-11T06:32:17","slug":"python-function","status":"publish","type":"post","link":"https:\/\/www.webhozz.com\/blog\/python-function\/","title":{"rendered":"Python Function"},"content":{"rendered":"\n<p>Function adalah blok kode yang hanya berjalan ketika dipanggil.<\/p>\n\n\n\n<p>Kamu dapat mengirimkan data, yang dikenal sebagai parameter, ke suatu fungsi.<\/p>\n\n\n\n<p>Suatu function dapat mengembalikan data sebagai hasilnya.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Menciptakan Function<\/strong><\/h4>\n\n\n\n<p>Dalam Python function didefinisikan menggunakan&nbsp;kata kunci&nbsp;def&nbsp;:<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function():\n  print(&quot;Hello from a function&quot;)\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Memanggil suatu Funcion<\/strong><\/h4>\n\n\n\n<p>Untuk memanggil suatu function, gunakan nama function yang diikuti oleh tanda kurung:<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function():\n  print(&quot;Hello from a function&quot;)\n \nmy_function()\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Argumen<\/strong><\/h4>\n\n\n\n<p>Informasi dapat diteruskan ke function sebagai argumen.<\/p>\n\n\n\n<p>Argumen ditentukan setelah nama function, di dalam tanda kurung.&nbsp;kamu dapat menambahkan argumen sebanyak yang kamu inginkan, cukup pisahkan dengan koma.<\/p>\n\n\n\n<p>Contoh berikut memiliki function dengan satu argumen (fname).&nbsp;Ketika function dipanggil, kami memberikan nama depan, yang digunakan di dalam function untuk mencetak nama lengkap:<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function(fname):\n  print(fname + &quot; Refsnes&quot;)\n \nmy_function(&quot;Emil&quot;)\nmy_function(&quot;Tobias&quot;)\nmy_function(&quot;Linus&quot;)\n<\/pre><\/div>\n\n\n<p><em>Argumen<\/em>&nbsp;sering disingkat menjadi&nbsp;<em>args<\/em>&nbsp;dalam dokumentasi Python.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Parameter atau Argumen?<\/strong><\/h4>\n\n\n\n<p>Istilah&nbsp;<em>&nbsp;parameter<\/em>&nbsp; dan&nbsp;<em>argumen<\/em>&nbsp;dapat digunakan untuk hal yang sama: informasi yang diteruskan ke function.<\/p>\n\n\n\n<p>Dari perspektif function:<\/p>\n\n\n\n<p>Parameter adalah variabel yang tercantum di dalam tanda kurung dalam definisi function.<\/p>\n\n\n\n<p>Argumen adalah nilai yang dikirim ke function saat dipanggil.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Jumlah Argumen<\/strong><\/h4>\n\n\n\n<p>Secara default, suatu fungsi harus dipanggil dengan jumlah argumen yang benar.&nbsp;Berarti bahwa jika fungsi Anda mengharapkan 2 argumen, Anda harus memanggil fungsi dengan 2 argumen, tidak lebih, dan tidak kurang.<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n\n<p>Function ini mengharapkan 2 argumen, dan mendapat 2 argumen:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function(fname, lname):\n  print(fname + &quot; &quot; + lname)\n \nmy_function(&quot;Emil&quot;, &quot;Refsnes&quot;)\n<\/pre><\/div>\n\n\n<p>Jika kamu mencoba memanggil function dengan 1 atau 3 argumen, kamu akan mendapatkan kesalahan:<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n\n<p>Function &nbsp;ini mengharapkan 2 argumen, tetapi hanya mendapat 1:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function(fname, lname):\n  print(fname + &quot; &quot; + lname)\n \nmy_function(&quot;Emil&quot;)\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Argumen Arbitrary, * args<\/strong><\/h4>\n\n\n\n<p>Jika kamu tidak tahu berapa banyak argumen yang akan diteruskan ke function kamu,<\/p>\n\n\n\n<p>tambahkan&nbsp;<code>*<\/code>sebelum nama parameter dalam definisi function.<\/p>\n\n\n\n<p>Dengan cara ini function akan menerima&nbsp;<em>tuple<\/em>&nbsp;argumen, dan dapat mengakses item:<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n\n<p>Jika jumlah argumen tidak diketahui, tambahkan&nbsp;<code>*<\/code>sebelum nama parameter:<\/p>\n\n\n\n<p><em>Argumen arbitrary<\/em>&nbsp;sering disingkat menjadi&nbsp;<em>* args<\/em>&nbsp;dalam dokumentasi Python.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Kata Kunci Argumen<\/strong><\/h4>\n\n\n\n<p>Kamu juga dapat mengirim argumen dengan&nbsp;sintaks&nbsp;<em>kunci<\/em>&nbsp;=&nbsp;<em>nilai<\/em>&nbsp;.<\/p>\n\n\n\n<p>Dengan cara ini urutan argumen tidak menjadi masalah.<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function(child3, child2, child1):\n  print(&quot;The youngest child is &quot; + child3)\n \nmy_function(child1 = &quot;Emil&quot;, child2 = &quot;Tobias&quot;, child3 = &quot;Linus&quot;)\n<\/pre><\/div>\n\n\n<p>Frasa&nbsp;<em>Kata Kunci<\/em>&nbsp;<em>&nbsp;Argumen&nbsp;<\/em>sering disingkat menjadi&nbsp;<em>kwargs<\/em>&nbsp;dalam dokumentasi Python.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Kata Kunci Argumen&nbsp;<\/strong><strong>Arbitrary<\/strong><strong>, ** kwargs<\/strong><\/h4>\n\n\n\n<p>Jika kamu tidak tahu berapa banyak kata kunci argumen yang akan diteruskan ke function kamu, tambahkan dua tanda bintang:&nbsp;<code>**<\/code>sebelum nama parameter dalam definisi function.<\/p>\n\n\n\n<p>Dengan cara ini function akan menerima&nbsp;<em>kamus<\/em>&nbsp;argumen, dan dapat mengakses item-item yang sesuai:<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n\n<p>Jika jumlah kata kunci argumen tidak diketahui, tambahkan ganda&nbsp;<code>**<\/code>sebelum nama parameter:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function(**kid):\n  print(&quot;His last name is &quot; + kid&#x5B;&quot;lname&quot;])\n \nmy_function(fname = &quot;Tobias&quot;, lname = &quot;Refsnes&quot;)\n<\/pre><\/div>\n\n\n<p><em>Argumen Kword arbitrary<\/em>&nbsp;sering disingkat menjadi&nbsp;<em>** kwargs<\/em>&nbsp;dalam dokumentasi Python.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Nilai Parameter Default<\/strong><\/h4>\n\n\n\n<p>Contoh berikut menunjukkan cara menggunakan nilai parameter default.<\/p>\n\n\n\n<p>Jika kita memanggil function tanpa argumen, itu menggunakan nilai default:<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function(country = &quot;Norway&quot;):\n  print(&quot;I am from &quot; + country)\n \nmy_function(&quot;Sweden&quot;)\nmy_function(&quot;India&quot;)\nmy_function()\nmy_function(&quot;Brazil&quot;)\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Lulus Daftar sebagai Argumen<\/strong><\/h4>\n\n\n\n<p>Anda dapat mengirim tipe data argumen apa pun ke suatu fungsi (string, angka, daftar, kamus, dll.), Dan itu akan diperlakukan sebagai tipe data yang sama di dalam fungsi.<\/p>\n\n\n\n<p>Misalnya, jika Anda mengirim Daftar sebagai argumen, itu masih akan menjadi Daftar ketika mencapai fungsi:<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function(food):\n  for x in food:\n    print(x)\n \nfruits = &#x5B;&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;]\n \nmy_function(fruits)\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Nilai Return<\/strong><\/h4>\n\n\n\n<p>Untuk membiarkan suatu fungsi mengembalikan nilai, gunakan&nbsp;pernyataan<code>&nbsp;return<\/code>&nbsp;:<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef my_function(x):\n  return 5 * x\n \nprint(my_function(3))\nprint(my_function(5))\nprint(my_function(9))\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Pernyataan lulus<\/strong><\/h4>\n\n\n\n<p>Definisi&nbsp;<code>Function&nbsp;<\/code>tidak boleh kosong, tetapi jika kamu memiliki&nbsp; suatu alasan, definisi&nbsp;<code>function&nbsp;<\/code>tanpa konten, masukkan&nbsp;pernyataan&nbsp;<code>pass&nbsp;<\/code>untuk menghindari kesalahan.<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef myfunction():\n  pass\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Loop<\/strong><\/h4>\n\n\n\n<p>Python juga menerima rekursi fungsi, yang berarti fungsi yang didefinisikan dapat memanggil dirinya sendiri.<\/p>\n\n\n\n<p>Rekursi adalah konsep matematika dan pemrograman yang umum.&nbsp;Ini berarti bahwa suatu fungsi memanggil dirinya sendiri.&nbsp;Ini memiliki manfaat dari arti bahwa kamu dapat mengulangi data untuk mencapai hasil.<\/p>\n\n\n\n<p>Pengembang harus sangat berhati-hati dengan rekursi karena dapat dengan mudah memasukkan fungsi yang tidak pernah berakhir, atau yang menggunakan jumlah memori atau daya prosesor yang berlebih.&nbsp;Namun, ketika ditulis dengan benar rekursi dapat menjadi pendekatan yang sangat efisien dan elegan secara matematis untuk pemrograman.<\/p>\n\n\n\n<p>Dalam contoh ini,&nbsp;tri_recursion ()&nbsp;adalah fungsi yang telah kita tentukan untuk memanggil dirinya sendiri (\u201crecurse\u201d).&nbsp;Kami menggunakan&nbsp;variabel&nbsp;k&nbsp;sebagai data, yang menurun (&nbsp;-1&nbsp;) setiap kali kami kambuh.&nbsp;Rekursi berakhir ketika kondisinya tidak lebih dari 0 (yaitu ketika 0).<\/p>\n\n\n\n<p>Untuk pengembang baru mungkin perlu waktu untuk mengetahui bagaimana tepatnya ini bekerja, cara terbaik untuk mengetahuinya adalah dengan menguji dan memodifikasinya.<\/p>\n\n\n\n<p>Contoh<\/p>\n\n\n\n<p>Contoh Rekursi<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef tri_recursion(k):\n  if(k&gt;0):\n    result = k+tri_recursion(k-1)\n    print(result)\n  else:\n    result = 0\n  return result\n \nprint(&quot;\\n\\nRecursion Example Results&quot;)\ntri_recursion(6)\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Function adalah blok kode yang hanya berjalan ketika dipanggil. Kamu dapat mengirimkan data, yang dikenal sebagai parameter, ke suatu fungsi. Suatu function dapat mengembalikan data<\/p>\n","protected":false},"author":1,"featured_media":10067,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2718],"tags":[4152,4148,4151,4150,4147,4149],"class_list":["post-12429","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-belajar-python","tag-belajar-python-function","tag-belajar-python-function-pemula","tag-kursus-python-function-bandung","tag-kursus-python-function-jakarta","tag-tutorial-python-function","tag-tutorial-python-function-pemula"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Function - WebHozz Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhozz.com\/blog\/python-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Function - WebHozz Blog\" \/>\n<meta property=\"og:description\" content=\"Function adalah blok kode yang hanya berjalan ketika dipanggil. Kamu dapat mengirimkan data, yang dikenal sebagai parameter, ke suatu fungsi. Suatu function dapat mengembalikan data\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhozz.com\/blog\/python-function\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHozz Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-08T10:53:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-11T06:32:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2019\/11\/Python.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#\\\/schema\\\/person\\\/d5f539ad171dc74baaf6a98dfef6fcef\"},\"headline\":\"Python Function\",\"datePublished\":\"2023-05-08T10:53:10+00:00\",\"dateModified\":\"2023-05-11T06:32:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/\"},\"wordCount\":684,\"publisher\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Python.jpg\",\"keywords\":[\"Belajar Python Function\",\"Belajar Python Function Pemula\",\"Kursus Python Function Bandung\",\"Kursus Python Function Jakarta\",\"Tutorial Python Function\",\"Tutorial Python Function Pemula\"],\"articleSection\":[\"Belajar Python\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/\",\"name\":\"Python Function - WebHozz Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Python.jpg\",\"datePublished\":\"2023-05-08T10:53:10+00:00\",\"dateModified\":\"2023-05-11T06:32:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Python.jpg\",\"contentUrl\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Python.jpg\",\"width\":750,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/python-function\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/\",\"name\":\"WebHozz Blog\",\"description\":\"Kursus Web &amp; Android di Jakarta Bandung\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#organization\",\"name\":\"WebHozz\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/logo-persegi.jpg\",\"contentUrl\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/logo-persegi.jpg\",\"width\":442,\"height\":442,\"caption\":\"WebHozz\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#\\\/schema\\\/person\\\/d5f539ad171dc74baaf6a98dfef6fcef\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Function - WebHozz Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webhozz.com\/blog\/python-function\/","og_locale":"en_US","og_type":"article","og_title":"Python Function - WebHozz Blog","og_description":"Function adalah blok kode yang hanya berjalan ketika dipanggil. Kamu dapat mengirimkan data, yang dikenal sebagai parameter, ke suatu fungsi. Suatu function dapat mengembalikan data","og_url":"https:\/\/www.webhozz.com\/blog\/python-function\/","og_site_name":"WebHozz Blog","article_published_time":"2023-05-08T10:53:10+00:00","article_modified_time":"2023-05-11T06:32:17+00:00","og_image":[{"width":750,"height":400,"url":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2019\/11\/Python.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webhozz.com\/blog\/python-function\/#article","isPartOf":{"@id":"https:\/\/www.webhozz.com\/blog\/python-function\/"},"author":{"name":"admin","@id":"https:\/\/www.webhozz.com\/blog\/#\/schema\/person\/d5f539ad171dc74baaf6a98dfef6fcef"},"headline":"Python Function","datePublished":"2023-05-08T10:53:10+00:00","dateModified":"2023-05-11T06:32:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhozz.com\/blog\/python-function\/"},"wordCount":684,"publisher":{"@id":"https:\/\/www.webhozz.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.webhozz.com\/blog\/python-function\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2019\/11\/Python.jpg","keywords":["Belajar Python Function","Belajar Python Function Pemula","Kursus Python Function Bandung","Kursus Python Function Jakarta","Tutorial Python Function","Tutorial Python Function Pemula"],"articleSection":["Belajar Python"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.webhozz.com\/blog\/python-function\/","url":"https:\/\/www.webhozz.com\/blog\/python-function\/","name":"Python Function - WebHozz Blog","isPartOf":{"@id":"https:\/\/www.webhozz.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webhozz.com\/blog\/python-function\/#primaryimage"},"image":{"@id":"https:\/\/www.webhozz.com\/blog\/python-function\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2019\/11\/Python.jpg","datePublished":"2023-05-08T10:53:10+00:00","dateModified":"2023-05-11T06:32:17+00:00","breadcrumb":{"@id":"https:\/\/www.webhozz.com\/blog\/python-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhozz.com\/blog\/python-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhozz.com\/blog\/python-function\/#primaryimage","url":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2019\/11\/Python.jpg","contentUrl":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2019\/11\/Python.jpg","width":750,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhozz.com\/blog\/python-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhozz.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python Function"}]},{"@type":"WebSite","@id":"https:\/\/www.webhozz.com\/blog\/#website","url":"https:\/\/www.webhozz.com\/blog\/","name":"WebHozz Blog","description":"Kursus Web &amp; Android di Jakarta Bandung","publisher":{"@id":"https:\/\/www.webhozz.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhozz.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhozz.com\/blog\/#organization","name":"WebHozz","url":"https:\/\/www.webhozz.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhozz.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2018\/04\/logo-persegi.jpg","contentUrl":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2018\/04\/logo-persegi.jpg","width":442,"height":442,"caption":"WebHozz"},"image":{"@id":"https:\/\/www.webhozz.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.webhozz.com\/blog\/#\/schema\/person\/d5f539ad171dc74baaf6a98dfef6fcef","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.webhozz.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/posts\/12429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/comments?post=12429"}],"version-history":[{"count":2,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/posts\/12429\/revisions"}],"predecessor-version":[{"id":12431,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/posts\/12429\/revisions\/12431"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/media\/10067"}],"wp:attachment":[{"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/media?parent=12429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/categories?post=12429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/tags?post=12429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}