{"id":44,"date":"2025-12-21T15:50:59","date_gmt":"2025-12-21T12:50:59","guid":{"rendered":"https:\/\/fpytontemellerif.free.nf\/?page_id=44"},"modified":"2026-03-16T20:37:54","modified_gmt":"2026-03-16T17:37:54","slug":"kosul-yapilari-if-elif-else","status":"publish","type":"page","link":"https:\/\/www.fpytontemellerif.com.tr\/?page_id=44","title":{"rendered":"KO\u015eUL YAPILARI (if \u2013 elif \u2013 else)"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Konuya Giri\u015f<\/h2>\n\n\n\n<p>Programlarda her zaman ayn\u0131 i\u015flemler yap\u0131lmaz. Baz\u0131 durumlarda belirli bir ko\u015ful sa\u011flan\u0131yorsa bir i\u015flem, sa\u011flanm\u0131yorsa farkl\u0131 bir i\u015flem yap\u0131lmas\u0131 gerekir. Python\u2019da bu t\u00fcr durumlar ko\u015ful yap\u0131lar\u0131 ile kontrol edilir. Ko\u015ful yap\u0131lar\u0131, programlar\u0131n karar verebilmesini sa\u011flar.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u00d6\u011frenme S\u00fcreci<\/h2>\n\n\n\n<p>Bu konuya ba\u015flan\u0131rken \u00f6ncelikle programlar\u0131n mant\u0131ksal kar\u015f\u0131la\u015ft\u0131rmalar yapabildi\u011fi \u00f6\u011frenilmi\u015ftir. Yap\u0131lan ilk denemelerde sadece tek bir ko\u015ful kullan\u0131lm\u0131\u015f, daha sonra birden fazla ko\u015fulun kontrol edilebildi\u011fi g\u00f6r\u00fclm\u00fc\u015ft\u00fcr. \u0130lerleyen denemelerde ko\u015fullar\u0131n s\u0131ral\u0131 \u015fekilde kontrol edildi\u011fi anla\u015f\u0131lm\u0131\u015ft\u0131r.<\/p>\n\n\n\n<p>Bu s\u00fcre\u00e7te girinti kullan\u0131m\u0131n\u0131n ko\u015ful yap\u0131lar\u0131nda \u00e7ok \u00f6nemli oldu\u011fu fark edilmi\u015ftir.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Kodlar<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 if Yap\u0131s\u0131 (Tek Ko\u015ful)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sayi = 10\n\nif sayi &gt; 5:\n    print(\"Say\u0131 5'ten b\u00fcy\u00fckt\u00fcr\")\n<\/code><\/pre>\n\n\n\n<p>Bu kodda ko\u015ful do\u011fru oldu\u011fu i\u00e7in ekrana yaz\u0131 yazd\u0131r\u0131lm\u0131\u015ft\u0131r.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 if \u2013 else Yap\u0131s\u0131<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>yas = 16\n\nif yas &gt;= 18:\n    print(\"Re\u015fitsiniz\")\nelse:\n    print(\"Re\u015fit de\u011filsiniz\")\n<\/code><\/pre>\n\n\n\n<p>Bu \u00f6rnekte ko\u015ful sa\u011flanmad\u0131\u011f\u0131 i\u00e7in <code>else<\/code> blo\u011fu \u00e7al\u0131\u015fm\u0131\u015ft\u0131r.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">3\ufe0f\u20e3 if \u2013 elif \u2013 else Yap\u0131s\u0131<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>notu = 75\n\nif notu &gt;= 85:\n    print(\"Pekiyi\")\nelif notu &gt;= 70:\n    print(\"\u0130yi\")\nelse:\n    print(\"Geli\u015ftirilmeli\")\n<\/code><\/pre>\n\n\n\n<p>Bu yap\u0131da birden fazla ko\u015ful s\u0131ras\u0131yla kontrol edilmi\u015ftir.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Kar\u015f\u0131la\u015f\u0131lan Hatalar<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c Hata 1: Girinti Hatas\u0131<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>if 5 &gt; 3:\nprint(\"Hata olu\u015fur\")\n<\/code><\/pre>\n\n\n\n<p>Girinti olmad\u0131\u011f\u0131 i\u00e7in Python hata verir.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c Hata 2: Yanl\u0131\u015f Kar\u015f\u0131la\u015ft\u0131rma Operat\u00f6r\u00fc<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>if sayi = 5:\n    print(\"Hata\")\n<\/code><\/pre>\n\n\n\n<p>Bu kullan\u0131m hatal\u0131d\u0131r. Kar\u015f\u0131la\u015ft\u0131rma i\u00e7in <code>==<\/code> kullan\u0131lmal\u0131d\u0131r.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">SIK SORULAN SORULAR ve CEVAPLARI<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2753 if ne i\u015fe yarar?<\/h3>\n\n\n\n<p>Bir ko\u015ful do\u011fruysa belirli bir kodun \u00e7al\u0131\u015fmas\u0131n\u0131 sa\u011flar.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2753 elif ne zaman kullan\u0131l\u0131r?<\/h3>\n\n\n\n<p>Birden fazla ko\u015ful kontrol edilecekse kullan\u0131l\u0131r.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2753 else ne i\u015fe yarar?<\/h3>\n\n\n\n<p>Hi\u00e7bir ko\u015ful sa\u011flanmad\u0131\u011f\u0131nda \u00e7al\u0131\u015f\u0131r.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2753 Ko\u015fullar hangi operat\u00f6rlerle kurulur?<\/h3>\n\n\n\n<p><code>==<\/code>, <code>!=<\/code>, <code>&gt;<\/code>, <code>&lt;<\/code>, <code>&gt;=<\/code>, <code>&lt;=<\/code> operat\u00f6rleri kullan\u0131l\u0131r. <\/p>\n\n\n\n<p>Bu operat\u00f6rler, program\u0131n bir karar vermesini sa\u011flar. Sonu\u00e7 her zaman ya <strong>&#8220;Do\u011fru&#8221; (True)<\/strong> ya da <strong>&#8220;Yanl\u0131\u015f&#8221; (False)<\/strong> \u00e7\u0131kar.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Operat\u00f6r<\/strong><\/td><td><strong>Anlam\u0131<\/strong><\/td><td><strong>Basit \u00d6rnek<\/strong><\/td><\/tr><\/thead><tbody><tr><td><strong><code>==<\/code><\/strong><\/td><td><strong>E\u015fit mi?<\/strong><\/td><td><code>5 == 5<\/code> (Do\u011fru)<\/td><\/tr><tr><td><strong><code>!=<\/code><\/strong><\/td><td><strong>E\u015fit de\u011fil mi?<\/strong><\/td><td><code>5 != 3<\/code> (Do\u011fru)<\/td><\/tr><tr><td><strong><code>&gt;<\/code><\/strong><\/td><td><strong>B\u00fcy\u00fck m\u00fc?<\/strong><\/td><td><code>10 &gt; 5<\/code> (Do\u011fru)<\/td><\/tr><tr><td><strong><code>&lt;<\/code><\/strong><\/td><td><strong>K\u00fc\u00e7\u00fck m\u00fc?<\/strong><\/td><td><code>2 &lt; 8<\/code> (Do\u011fru)<\/td><\/tr><tr><td><strong><code>&gt;=<\/code><\/strong><\/td><td><strong>B\u00fcy\u00fck veya e\u015fit mi?<\/strong><\/td><td><code>5 &gt;= 5<\/code> (Do\u011fru)<\/td><\/tr><tr><td><strong><code>&lt;=<\/code><\/strong><\/td><td><strong>K\u00fc\u00e7\u00fck veya e\u015fit mi?<\/strong><\/td><td><code>3 &lt;= 5<\/code> (Do\u011fru)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2753 Ko\u015fullar s\u0131rayla m\u0131 \u00e7al\u0131\u015f\u0131r?<\/h3>\n\n\n\n<p>Evet. \u0130lk do\u011fru ko\u015ful bulundu\u011funda di\u011ferleri \u00e7al\u0131\u015fmaz.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Sonu\u00e7<\/h2>\n\n\n\n<p>Bu konu sayesinde Python\u2019da karar verme yap\u0131lar\u0131n\u0131n nas\u0131l kuruldu\u011fu \u00f6\u011frenilmi\u015ftir. Ko\u015ful yap\u0131lar\u0131, programlar\u0131n kullan\u0131c\u0131dan gelen verilere g\u00f6re farkl\u0131 sonu\u00e7lar \u00fcretmesini sa\u011flar ve yaz\u0131l\u0131m\u0131n temel ta\u015flar\u0131ndan biridir.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/www.fpytontemellerif.com.tr\/?page_id=46\">Devam etmek \u0130\u00e7in t\u0131klay\u0131n<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Konuya Giri\u015f Programlarda her zaman ayn\u0131 i\u015flemler yap\u0131lmaz. Baz\u0131 durumlarda belirli bir ko\u015ful sa\u011flan\u0131yorsa bir i\u015flem, sa\u011flanm\u0131yorsa farkl\u0131 bir i\u015flem yap\u0131lmas\u0131 gerekir. Python\u2019da bu t\u00fcr durumlar ko\u015ful yap\u0131lar\u0131 ile kontrol edilir. Ko\u015ful yap\u0131lar\u0131, programlar\u0131n karar verebilmesini sa\u011flar. \u00d6\u011frenme S\u00fcreci Bu<\/p>\n<p><a href=\"https:\/\/www.fpytontemellerif.com.tr\/?page_id=44\" class=\"awp-btn awp-btn-secondary awp-btn-bubble\">Continue Reading<span class=\"screen-reader-text\">KO\u015eUL YAPILARI (if \u2013 elif \u2013 else)<\/span><i class=\"fa fa-arrow-right\"><\/i><span class=\"bubble_effect\"><span class=\"circle top-left\"><\/span><span class=\"circle top-left\"><\/span><span class=\"circle top-left\"><\/span>\t<span class=\"button effect-button\"><\/span><span class=\"circle bottom-right\"><\/span>\t<span class=\"circle bottom-right\"><\/span><span class=\"circle bottom-right\"><\/span><\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-44","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.fpytontemellerif.com.tr\/index.php?rest_route=\/wp\/v2\/pages\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fpytontemellerif.com.tr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.fpytontemellerif.com.tr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.fpytontemellerif.com.tr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fpytontemellerif.com.tr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44"}],"version-history":[{"count":2,"href":"https:\/\/www.fpytontemellerif.com.tr\/index.php?rest_route=\/wp\/v2\/pages\/44\/revisions"}],"predecessor-version":[{"id":487,"href":"https:\/\/www.fpytontemellerif.com.tr\/index.php?rest_route=\/wp\/v2\/pages\/44\/revisions\/487"}],"wp:attachment":[{"href":"https:\/\/www.fpytontemellerif.com.tr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}