{"id":896,"date":"2023-07-28T09:44:03","date_gmt":"2023-07-28T09:44:03","guid":{"rendered":"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/"},"modified":"2023-07-28T09:44:03","modified_gmt":"2023-07-28T09:44:03","slug":"liste-pythondaki-degerleri-degistir","status":"publish","type":"post","link":"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/","title":{"rendered":"Python&#39;da bir listedeki de\u011ferler nas\u0131l de\u011fi\u015ftirilir?"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u00c7o\u011fu zaman Python&#8217;da bir listedeki bir veya daha fazla de\u011feri de\u011fi\u015ftirmek isteyebilirsiniz.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Neyse ki Python&#8217;da bunu yapmak kolayd\u0131r ve bu e\u011fitimde birka\u00e7 farkl\u0131 \u00f6rnek a\u00e7\u0131klanmaktad\u0131r.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>\u00d6rnek 1: Listedeki tek bir de\u011feri de\u011fi\u015ftirme<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki s\u00f6zdizimi Python&#8217;da bir listedeki tek bir de\u011ferin nas\u0131l de\u011fi\u015ftirilece\u011fini g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #008080;\"><strong>#create list of 4 items<\/strong><\/span>\n<strong>x = ['a', 'b', 'c', 'd']<\/strong>\n\n<span style=\"color: #008080;\"><strong>#replace first item in list<\/strong><\/span>\n<strong>x[ <span style=\"color: #008000;\">0<\/span> ] = 'z'<\/strong>\n\n<span style=\"color: #008080;\"><strong>#view updated list<\/strong><\/span>\n<strong>x\n\n['z', 'b', 'c', 'd']\n<\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>\u00d6rnek 2: Listedeki birden \u00e7ok de\u011feri de\u011fi\u015ftirme<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki s\u00f6zdizimi Python&#8217;da bir listedeki birden \u00e7ok de\u011ferin nas\u0131l de\u011fi\u015ftirilece\u011fini g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #008080;\"><strong>#create list of 4 items<\/strong><\/span>\n<strong>x = ['a', 'b', 'c', 'd']<\/strong>\n\n<span style=\"color: #008080;\"><strong>#replace first three items in list<\/strong><\/span>\n<strong>x[ <span style=\"color: #008000;\">0:3<\/span> ] = ['x', 'y', 'z']<\/strong>\n\n<span style=\"color: #008080;\"><strong>#view updated list<\/strong><\/span>\n<strong>x\n\n['x', 'y', 'z', 'd']<\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>\u00d6rnek 3: Listedeki belirli de\u011ferleri de\u011fi\u015ftirme<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki s\u00f6zdizimi Python&#8217;da bir listedeki belirli de\u011ferlerin nas\u0131l de\u011fi\u015ftirilece\u011fini g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#create list of 6 items\n<\/span>y = [1, 1, 1, 2, 3, 7]\n\n<span style=\"color: #008080;\">#replace 1's with 0's\n<\/span>y = [0 if x==1 else x for x in y]\n\n<span style=\"color: #008080;\">#view updated list\n<\/span>y\n\n[0, 0, 0, 2, 3, 7]\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Belirli bir e\u015fi\u011fin \u00fczerindeki de\u011ferleri de\u011fi\u015ftirmek i\u00e7in a\u015fa\u011f\u0131daki s\u00f6zdizimini de kullanabilirsiniz:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#create list of 6 items\n<\/span>y = [1, 1, 1, 2, 3, 7]\n\n<span style=\"color: #008080;\">#replace all values above 1 with a '0'\n<\/span>y = [0 if x&gt;1 else x for x in y]\n\n<span style=\"color: #008080;\">#view updated list\n<\/span>y\n\n[1, 1, 1, 0, 0, 0]\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Benzer \u015fekilde, belirli bir e\u015fi\u011fe e\u015fit veya ondan k\u00fc\u00e7\u00fck de\u011ferleri de de\u011fi\u015ftirebilirsiniz:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#create list of 6 items\n<\/span>y = [1, 1, 1, 2, 3, 7]\n\n<span style=\"color: #008080;\">#replace all values less than or equal to 2 to '0'\n<\/span>y = [0 if x&lt;=2 else x for x in y]\n\n<span style=\"color: #008080;\">#view updated list\n<\/span>y\n\n[0, 0, 0, 0, 3, 7]<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\"><em>Daha fazla Python e\u011fitimini burada bulabilirsiniz.<\/em><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c7o\u011fu zaman Python&#8217;da bir listedeki bir veya daha fazla de\u011feri de\u011fi\u015ftirmek isteyebilirsiniz. Neyse ki Python&#8217;da bunu yapmak kolayd\u0131r ve bu e\u011fitimde birka\u00e7 farkl\u0131 \u00f6rnek a\u00e7\u0131klanmaktad\u0131r. \u00d6rnek 1: Listedeki tek bir de\u011feri de\u011fi\u015ftirme A\u015fa\u011f\u0131daki s\u00f6zdizimi Python&#8217;da bir listedeki tek bir de\u011ferin nas\u0131l de\u011fi\u015ftirilece\u011fini g\u00f6sterir: #create list of 4 items x = [&#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;, &#8216;d&#8217;] #replace [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-896","post","type-post","status-publish","format-standard","hentry","category-rehber"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python&#039;da bir listedeki de\u011ferler nas\u0131l de\u011fi\u015ftirilir - Statorials<\/title>\n<meta name=\"description\" content=\"Python&#039;da bir listedeki de\u011ferlerin nas\u0131l de\u011fi\u015ftirilece\u011fine dair birka\u00e7 \u00f6rnek i\u00e7eren basit bir a\u00e7\u0131klama.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python&#039;da bir listedeki de\u011ferler nas\u0131l de\u011fi\u015ftirilir - Statorials\" \/>\n<meta property=\"og:description\" content=\"Python&#039;da bir listedeki de\u011ferlerin nas\u0131l de\u011fi\u015ftirilece\u011fine dair birka\u00e7 \u00f6rnek i\u00e7eren basit bir a\u00e7\u0131klama.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-28T09:44:03+00:00\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/\",\"url\":\"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/\",\"name\":\"Python&#39;da bir listedeki de\u011ferler nas\u0131l de\u011fi\u015ftirilir - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/tr\/#website\"},\"datePublished\":\"2023-07-28T09:44:03+00:00\",\"dateModified\":\"2023-07-28T09:44:03+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\"},\"description\":\"Python&#39;da bir listedeki de\u011ferlerin nas\u0131l de\u011fi\u015ftirilece\u011fine dair birka\u00e7 \u00f6rnek i\u00e7eren basit bir a\u00e7\u0131klama.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ev\",\"item\":\"https:\/\/statorials.org\/tr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python&#39;da bir listedeki de\u011ferler nas\u0131l de\u011fi\u015ftirilir?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/tr\/#website\",\"url\":\"https:\/\/statorials.org\/tr\/\",\"name\":\"Statorials\",\"description\":\"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/tr\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil\",\"sameAs\":[\"https:\/\/statorials.org\/tr\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python&#39;da bir listedeki de\u011ferler nas\u0131l de\u011fi\u015ftirilir - Statorials","description":"Python&#39;da bir listedeki de\u011ferlerin nas\u0131l de\u011fi\u015ftirilece\u011fine dair birka\u00e7 \u00f6rnek i\u00e7eren basit bir a\u00e7\u0131klama.","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:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/","og_locale":"tr_TR","og_type":"article","og_title":"Python&#39;da bir listedeki de\u011ferler nas\u0131l de\u011fi\u015ftirilir - Statorials","og_description":"Python&#39;da bir listedeki de\u011ferlerin nas\u0131l de\u011fi\u015ftirilece\u011fine dair birka\u00e7 \u00f6rnek i\u00e7eren basit bir a\u00e7\u0131klama.","og_url":"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/","og_site_name":"Statorials","article_published_time":"2023-07-28T09:44:03+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Dr.benjamin anderson","Tahmini okuma s\u00fcresi":"1 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/","url":"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/","name":"Python&#39;da bir listedeki de\u011ferler nas\u0131l de\u011fi\u015ftirilir - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/tr\/#website"},"datePublished":"2023-07-28T09:44:03+00:00","dateModified":"2023-07-28T09:44:03+00:00","author":{"@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48"},"description":"Python&#39;da bir listedeki de\u011ferlerin nas\u0131l de\u011fi\u015ftirilece\u011fine dair birka\u00e7 \u00f6rnek i\u00e7eren basit bir a\u00e7\u0131klama.","breadcrumb":{"@id":"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/tr\/liste-pythondaki-degerleri-degistir\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Ev","item":"https:\/\/statorials.org\/tr\/"},{"@type":"ListItem","position":2,"name":"Python&#39;da bir listedeki de\u011ferler nas\u0131l de\u011fi\u015ftirilir?"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/tr\/#website","url":"https:\/\/statorials.org\/tr\/","name":"Statorials","description":"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/tr\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"tr"},{"@type":"Person","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil","sameAs":["https:\/\/statorials.org\/tr"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/comments?post=896"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/896\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/media?parent=896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/categories?post=896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/tags?post=896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}