<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Başak Dilara Avcı on Medium]]></title>
        <description><![CDATA[Stories by Başak Dilara Avcı on Medium]]></description>
        <link>https://medium.com/@basakdilaraavci?source=rss-a0d31ab9b0cc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*af2WIx0Yy-G9IITXkkdCew.png</url>
            <title>Stories by Başak Dilara Avcı on Medium</title>
            <link>https://medium.com/@basakdilaraavci?source=rss-a0d31ab9b0cc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:28:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@basakdilaraavci/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[You Can Vibe Code an App in Days. The Product Part Is Where Things Get Weird]]></title>
            <link>https://basakdilaraavci.medium.com/you-can-vibe-code-an-app-in-days-the-product-part-is-where-things-get-weird-4b9cb6837d24?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b9cb6837d24</guid>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Mon, 27 Jul 2026 20:34:33 GMT</pubDate>
            <atom:updated>2026-07-27T20:34:33.430Z</atom:updated>
            <content:encoded><![CDATA[<p>We all know that creating an app has recently become much more accessible.</p><p>Of course, you still need some technical literacy, a decent idea, access to AI tools, and enough patience to explain the same bug four different ways to one agent, then repeat the whole performance with four others.</p><p>But especially over the last year, a <strong>single person</strong> has become capable of building a surprisingly <strong>large application</strong> with some guidance and a lot of vibe coding.</p><p>For those who might not know, <em>vibe coding</em> basically means using an AI agent to write most of the actual code. Sometimes you review every line carefully. Sometimes you look at the screen, see that the button works, and decide that this is a problem for <em>Future You.</em></p><p>I do not recommend making a habit of the second approach. AI agents can generate an enormous amount of code, and repeatedly pushing everything to production without reading it is how a fun experiment quietly turns into <em>AI slop</em>. My minimum standard for my own projects is simple: even if I did not write every line myself, I should at least <strong>understand</strong> what it does and why it is there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v5smOD8Com_dCbAQXDNWrw.png" /><figcaption>Building an app vs. building a product. AI-generated concept illustration.</figcaption></figure><p>I have been experimenting with small AI-assisted apps for the last few years, and I have to say, my latest attempts have felt kind of epic. Things that would normally remain inside my notes until the end of time can now become functioning applications in a few days.</p><p><em>The pages exist. The database exists. The buttons are doing button things.</em></p><p>It feels genuinely magical, especially because I remember how much time I spent coding a tiny Snake game while I was learning. A decade ago, even creating a fancy graph in R at university could easily consume several hours.</p><p>But hey, we are not talking about <strong>quality</strong> just yet. So far, we are only talking about <strong>capability.</strong> Producing a quality app, oh man, that is a whole <strong>different </strong>story.</p><p>That is what this article is really about. I realized that the engineering problem that now scares me is not whether I can make the code work. It is whether I can create something genuinely <strong>valuable</strong> with it.</p><h3>The Code Wasn’t the Hardest Part</h3><p>Let us say you are building a <strong>meditation app</strong>. At first, the plan looks simple enough.</p><p>You need some meditations, an audio player, perhaps a timer, a few breathing exercises, and a peaceful interface that does not look like it is about to sell you cryptocurrency.</p><p>AI can help you build all of that surprisingly <strong>quickly</strong>. But then the actual questions begin.</p><p>While working with my team on a workplace wellness product, we wanted every meditation, breathing exercise, and guided flow to be only <strong>one click away.</strong></p><p>Someone might open the app while stressed, tired, distracted, or sitting between two meetings. They should not need to complete a side quest just to begin a three-minute breathing exercise. Most people already have enough side quests in their workday.</p><p>Our first instinct was simple: why not put everything on the same page?</p><p><em>The meditations, quick exercises, breathing sessions, guided flows, experimental content, and perhaps eventually custom flows created by other people.</em> It could become a huge library.</p><p>Before implementing that idea, we looked at other meditation and wellness apps to understand the <strong>usual patterns and standards</strong>. The research was supposed to give us clarity.</p><p>Instead, we got <strong>lost</strong>.</p><p>We moved through enormous libraries, overlapping categories, recommendations, courses, filters, and collections. Sometimes we forgot what we had originally opened the app to find.</p><p>We never built our own fifty-option version. Seeing how easily we became lost in other products was enough to make us reconsider it.</p><p>On paper, the original idea sounds perfect. Everything is <strong>visible</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wKIBIjEGe5UfBpmTXfTXGQ.png" /><figcaption><em>AI-generated concept illustration.</em></figcaption></figure><p>But imagine opening the app and finding fifty different options staring back at you.</p><p>Do you need <em>a calming meditation? A focus session? A two-minute reset? A five-minute reset? Breathing? Visualization?</em></p><p>And what happens if you choose the wrong one and waste most of your precious ten-minute break during a hectic workday on something that does not help?</p><p>Perhaps you need something for stress, energy, sleep, confidence, or anxiety. Or perhaps your brain has simply turned into fifteen browser tabs playing audio at the same time, and you do not know what category that belongs to.</p><p>Technically, everything is <strong>accessible.</strong></p><p>But choosing something has now become <strong>work.</strong></p><h3>Too Many Options Are Bad. Except When Too Few Options Are Also Bad.</h3><p>There is a concept called <em>choice overload.</em></p><p>The basic idea is that giving people <strong>more options</strong> can sometimes make decisions <strong>harder</strong> rather than easier. But it is not as simple as saying, “Humans see many buttons and immediately collapse.”</p><p>People often enjoy having many choices, especially when they already know what they want and the options are easy to compare.</p><p>The problem becomes more likely when the user is <strong>uncertain</strong>, the choices look <strong>similar</strong>, or the decision itself requires too much <strong>mental effort</strong>. In our case, the person opening the app may already be <strong>mentally exhausted.</strong></p><p>So perhaps we should show only <strong>a few options</strong>. Maybe three recommended sessions on the home page.</p><p>Much cleaner. Problem solved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T-0rw2xEFH5DGmgaD5dfZA.png" /><figcaption><em>AI-generated concept illustration.</em></figcaption></figure><p>Except now a new user might look at the same page and think:</p><p><em>“Is this it?”</em></p><p>They may assume the app is unfinished. They may think there is not enough content, or that the particular exercise they need probably does not exist.</p><p>So we arrived at one of those lovely product situations where two opposite decisions can both be wrong.</p><p><strong>Show everything</strong>, and the user may feel overwhelmed.</p><p><strong>Show too little</strong>, and the product may feel empty.</p><p>This is where product design stops being a list of features and becomes a series of tiny negotiations.</p><p>Perhaps the home page should show only what could help right now, while keeping the full library easy to reach. People who know what they need should be able to search, and returning users should quickly find the exercises that worked for them before.</p><p>“One click away” does not necessarily mean placing the entire product on one page and hoping everyone survives. Sometimes it means understanding which one click matters at that particular moment.</p><p>And that click will <strong>not </strong>be the same for everyone.</p><h3>Then You Decide Your Product Should Be for Everyone</h3><p>Things become even more complicated when your <strong>target audience</strong> is broad.</p><p><em>What if you want the product to be usable by young adults as well as older people?</em></p><p><em>By people who use technology all day and people who would rather not touch another screen after work?</em></p><p><em>By complete beginners and people who have been meditating for years?</em></p><p>That left us with another set of questions. How complex should the system be? Should it provide many features and detailed settings, or should it remain simple enough for anyone to understand immediately?</p><p>Every new capability makes the product <strong>more useful </strong>for someone. It can also make it <strong>more confusing</strong> for someone else.</p><p>This does not mean removing every advanced feature and leaving one enormous button in the middle of the screen. <strong>Complexity</strong> can exist. It just does not need to greet every user at the door.</p><p>A person who wants to press a button and breathe for two minutes should be able to do exactly that.</p><p>Someone who wants to choose the duration, guidance style, background audio, animation level, and session structure should also be able to do that.</p><p>They simply do not need to see the same interface at the same time. Designing a product for different kinds of people does not mean showing every possibility to everyone.</p><p>Age alone also does not tell you how comfortable someone is with technology. Some older users understand interfaces better than the people designing them. Some younger users will leave the moment they cannot find the correct button within six seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GHAHxLB6O9bQk22MNMWYA.png" /><figcaption><em>AI-generated concept illustration.</em></figcaption></figure><p>The useful question is not only:</p><p><em>“How old is this user?”</em></p><p>It is:</p><p><strong><em>“What are they trying to do, and what are we putting between them and that action?”</em></strong></p><h3>Meditation Apps Have a Very Strange Retention Problem</h3><p>There is another huge <strong>dilemma</strong> for meditation apps.</p><p>If someone wants to know whether meditation actually helps them, one random session usually is not much to go on.</p><p>It may feel great. It may also feel boring, uncomfortable, confusing, or suspiciously long despite lasting only four minutes. The product therefore needs to give people a reason to return, at least long enough to notice whether the practice is doing anything for them.</p><p>Luckily, the product world already has plenty of ways to encourage that.</p><p><em>Notifications, progress bars, daily streaks, badges, levels, and little celebrations.</em></p><p>A tiny burst of digital confetti because you managed to sit quietly for three minutes.</p><p>This is usually called <strong>gamification</strong>, and gamification is not automatically evil. It can make <strong>progress</strong> visible, help people remember something they genuinely wanted to do, and create a sense of structure at the beginning of a new habit.</p><p>But meditation makes the whole situation slightly awkward.</p><p>Many meditation practices are supposed to help people step away from constant stimulation, achievement, scoring, and external validation.</p><p>Then the meditation app appears and says:</p><blockquote>“Great job! You are now Level 14 Calm. Come back tomorrow or lose your fancy fire icon.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iiBwpKSFw2Y1BgBybiLWVA.png" /><figcaption><em>AI-generated concept illustration.</em></figcaption></figure><p>There is something a little strange about that.</p><p>A streak might encourage someone to practice regularly. It might also make them feel guilty when they miss a day. I am slightly ashamed to admit that when I lost my <em>362-day Duolingo streak</em>, I cried a little and felt like a complete failure for several days.</p><p>A badge might help someone notice their progress. It might also move their attention away from how the practice feels and toward collecting the next shiny object.</p><p>External rewards do not always destroy motivation. It depends on how they are designed and how the person experiences them.</p><p>But we should still ask what exactly we are encouraging.</p><p><em>Are we </em><strong><em>helping</em></strong><em> someone build a practice? Or are we simply teaching them to open another app every day?</em></p><p>Those two things can look identical in an analytics dashboard. They are not identical in<strong> a person’s life</strong>.</p><h3>So How Do You Keep People Coming Back Without Turning Meditation Into Duolingo for Breathing?</h3><p>Honestly, I do <strong>not </strong>think there is one perfect answer.</p><p>But perhaps continuity does not have to feel like pressure.</p><p>Instead of punishing someone for missing a day, the product could make returning feel normal. Instead of saying, “You broke your streak,” it could say, “Welcome back.”</p><p>Instead of measuring only how many minutes someone completed, the app could help them notice what happened during those minutes.</p><p><em>Did an exercise help before an important meeting? Did they feel more focused afterward? Was the session too long? Did they prefer silence? Did the breathing exercise calm them down, or did it simply make them strangely aware of their own nose?</em></p><p>The app could also help people connect meditation to moments that already exist in their lives: after waking up, before starting work, during lunch, before a job interview or presentation, or after closing the laptop.</p><p>But even then, we should not act as though we have discovered the one scientifically approved routine that will work for every human.</p><p>Most product research does not say:</p><p><em>“This feature works. Put it in the app immediately.”</em></p><p>It usually says something closer to:</p><p><em>“This </em><strong><em>may</em></strong><em> help some people under certain conditions, but the sample was limited, and you should probably test it yourself.”</em></p><p>It is less dramatic, but much more <strong>honest</strong>.</p><h3>There Are Thousands of Decisions Like This</h3><p>These are only a few examples. There are <strong>many more</strong>.</p><p><em>Should a session begin immediately, or should there be a short introduction? Should the app ask how the user feels, and would that feel supportive or intrusive?</em></p><p><em>How much text is calming? At what point does calming text become another article the user did not ask to read?</em></p><p><strong>Explain too much</strong>, and the wall of text may become stressful by itself. <strong>Explain too little</strong>, and someone may stare at the screen for five minutes before closing the page.</p><p>Animations might make the experience feel alive, but they may also create problems for people who are sensitive to motion.</p><p>Asking users to create an account could support personalization, but it might also prevent them from trying the product at all.</p><p><em>Should progress be visible? How often can the app send a “gentle reminder” before it starts behaving like an obsessive digital partner?</em></p><p>You can ask an AI agent to implement any of these decisions. But it <strong>cannot </strong>decide which one respects the user.</p><p>It <strong>does not</strong> experience distraction, pressure, guilt, motion sensitivity, or an exhausting workday. Because of that, a technically reasonable suggestion can still be the <strong>wrong</strong> one.</p><p>That part remains <strong>ours.</strong></p><p>There are also business decisions inside all of this.</p><p>You can design a product around keeping people on the screen for as long as possible. You can turn every feature into an upgrade. You can create fifteen different subscription gates and place a tiny crown icon on everything useful.</p><p>Or you can try to build something that provides <strong>real value </strong>without constantly trying to squeeze another action, another minute, or another payment out of the user.</p><p>Of course, the product still needs to <strong>make money</strong>. Servers do not run on <em>inner peace</em>.</p><p>But revenue does not need to answer every design question. Sometimes the most respectful version of a meditation product is the one that helps the user and then lets them leave.</p><h3>Why I Am Not Sharing the App Yet</h3><p>I have included a few concept illustrations throughout this article, but I am not ready to share the actual product we are developing with my team yet.</p><p>Yes, you can vibe code a huge application in days. You can generate pages, components, databases, animations, settings, and enough features to make the interface resemble the control panel of a small spaceship.</p><p>But turning that application into a <strong>high-quality</strong>, <strong>living experience</strong> takes much more time and a <strong>human touch</strong>.</p><p>Actually, it takes more than one human touch.</p><p>When you want to create something for different kinds of people, you need <strong>different people</strong>. You need feedback, constructive criticism, and people who misunderstand your interface in ways that never occurred to you.</p><p>Instead of explaining why the design is actually very clever, you need to stop and ask why it was <strong>misunderstood </strong>in the first place.</p><p>You need accessibility testing and careful consideration. Sometimes you need to remove features you spent days building because your beautiful feature has become a decorative obstacle.</p><p>AI can write code. It can create screens and pages, suggest alternatives, find bugs, write tests, and help a small team build something that would once have required far more people.</p><p>That is <strong>incredible</strong>.</p><p>But it cannot decide what kind of relationship your product should have with the person using it. It cannot decide whether retention supports the user or merely supports the metrics. It cannot decide whether a feature creates value or simply creates more product.</p><p>Those decisions still need <strong>people</strong>. Usually, many of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uj37plw6UUubO_wr6q6_KA.png" /><figcaption><em>AI-generated concept illustration.</em></figcaption></figure><p>So yes, creating an app is becoming easier.</p><p>Creating a product people can <strong>trust </strong>is still difficult.</p><p>And honestly, I think that is where the interesting part begins.</p><p><em>Transparency note: I wrote the original draft and used AI to help polish the English, tighten a few sections, and create the concept illustrations. The product examples and opinions come from my own work.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b9cb6837d24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python ile Ev Yapımı ChatGPT]]></title>
            <link>https://basakdilaraavci.medium.com/python-ile-ev-yap%C4%B1m%C4%B1-chatgpt-8d0a9b87c02a?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d0a9b87c02a</guid>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[text-davinci-003]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Wed, 18 Jan 2023 03:30:36 GMT</pubDate>
            <atom:updated>2023-01-18T03:30:36.482Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*VyzuVlWRVyQ5cse8kv4JKw.gif" /></figure><p>LinkedIn’de gördüğüm bir Orkun Işıtmak videosu sonrası Python ile OpenAI API kullanarak kendi ChatGPT botumu yapmaya karar verdim.</p><p>Videoya şu linkten ulaşabilirsiniz: <a href="https://www.youtube.com/watch?v=O4DhQ1BoFnU&amp;ab_channel=Orkunv2">‘şu link’</a> 😅</p><p>Nasıl yapıldığını kısaca anlatmak istiyorum.</p><p><a href="https://beta.openai.com/overview">OpenAI</a> adresine giriş yaptıktan sonra sağ üstten kendi API <em>key</em>inizi almanız gerekmektedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*9-JGnuJ983NJoUNZqMbGUA.png" /></figure><p>İlk kullanımda 18 dolarlık bir bakiyemiz bulunuyor ve Davinci modelinin fiyatlandırması 1000 token başına $0.02. İngilizce dili için 1000 token ise yaklaşık 750 kelimeye denk gelmektedir. Dolayısıyla ev yapımı bir bot için fazlasıyla kullanım sağlıyor.</p><p>Model olarak son yayınlananlar<em> ‘text-davinci-003’, ‘text-curie-001’, ‘text-babbage-001’, ‘text-ada-001’</em> olmak üzere dört tanedir. Bunlardan Davinci en güçlüsü ancak en maliyetli olanıdır, Ada ise en hızlı olanıdır.</p><p>Öncelikle <em>gpt3.py </em>adında bir <strong>py</strong> dosyası oluşturdum. API <em>key</em>i kullanarak <em>response</em> isteğinde bulundum. <em>temperature</em> arttıkça modelin yaratıcılığını yükselten bir parametredir.<em> max_token</em>s ise yanıtlarda çıktı olarak alabileceğimiz maksimum kelime sayısını belirtmektedir. 150 gibi düşük bir limit kullanmak zorunda kaldım, çünkü 18 dolar bakiyemi aşıp bu döviz kurunda dolar cinsinden ödeme yapmak istemiyorum. 😂</p><p>Son olarak bu yanıt isteğimizden ilk seçeneğin metin parçasını döndürmesini sağlıyoruz. Parametreler hakkında daha fazla bilgi sahibi olmak için OpenAI dokümanlarına göz gezdirebilirsiniz. -&gt; ‘<a href="https://beta.openai.com/docs/api-reference/completions/create">OpenAI </a>’</p><pre>import openai<br><br>def askGPT3(question):<br>    openai.api_key = &lt;YOUR-API-KEY&gt;<br>    response = openai.Completion.create(<br>        engine=&quot;text-davinci-003&quot;,<br>        prompt=question,<br>        temperature=0.9,<br>        max_tokens=150,<br>        top_p=1,<br>        frequency_penalty=0,<br>        presence_penalty=0.6,<br>    )<br>    return response.choices[0].text</pre><p>App tarafında ise Flask kullandım. Method parametresi, form verileri gönderilirken kullanılacak HTTP yöntemini belirtir. (<em>GET veya POST</em>) Çok basit bir Flask mimarisi oluşturarak daha önceden yazdığım <em>askGPT3 </em>fonksiyonunun çıktısını POST yöntemi ile veriyi sunucuya gönderdim.</p><pre>from flask import Flask, render_template, request<br>import gpt3<br><br>app = Flask(__name__, template_folder=&#39;docs&#39;)<br>app.static_folder = &#39;docs&#39;<br>app.jinja_env.auto_reload = True<br><br>@app.route(&quot;/&quot;)<br>def home():<br>    return render_template(&quot;index.html&quot;)<br><br><br>@app.route(&quot;/askGPT3&quot;, methods=[&quot;POST&quot;])<br>def GPT3():<br>    question = request.form[&quot;question&quot;]<br>    answer = gpt3.askGPT3(question)<br>    return render_template(&quot;index.html&quot;, answer=answer)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    app.run(debug=True)</pre><pre>HTML ve CSS için bulabildiğim kaynakları birleştirerek basit bir arayüz oluşturdum. Yanlışlık olabilir çünkü epey deneysel hazırladım ancak çalışıyor. Amacım için fazlasıyla yeterli.😅 </pre><pre> &lt;!DOCTYPE html&gt;<br> &lt;html lang=&quot;en&quot;&gt;<br> &lt;head&gt;<br>     &lt;meta charset=&quot;UTF-8&quot;&gt;<br>     &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>     &lt;title&gt;GPT-3 Chatbot&lt;/title&gt;<br>     &lt;link rel=&quot;stylesheet&quot; href=&quot;https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css&quot;<br><br>           integrity=&quot;sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z&quot;<br>           crossorigin=&quot;anonymous&quot;&gt;<br>     &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css&quot;<br>           integrity=&quot;sha256-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1c=&quot; crossorigin=&quot;anonymous&quot;/&gt;<br> &lt;/head&gt;<br> &lt;body&gt;<br> &lt;div class=&quot;container&quot;&gt;<br>     &lt;div class=&quot;row&quot;&gt;<br>         &lt;div class=&quot;col-md-12&quot;&gt;<br>             &lt;div class=&quot;card mt-5&quot;&gt;<br>                 &lt;div class=&quot;card-header&quot;&gt;<br>                     &lt;h3 class=&quot;text-center&quot;&gt;GPT-3&lt;/h3&gt;<br>                 &lt;/div&gt;<br>                 &lt;div class=&quot;card-body&quot;&gt;<br>                     &lt;form action=&quot;/askGPT3&quot; method=&quot;POST&quot;&gt;<br>                         &lt;div class=&quot;form-group&quot;&gt;<br>                         &lt;label for=&quot;question&quot;&gt;Soru&lt;/label&gt;<br>                         &lt;input type=&quot;text&quot; class=&quot;form-control&quot; name=&quot;question&quot; id=&quot;question&quot; placeholder=&quot;Soru&quot;&gt;<br>                         &lt;/div&gt;<br>                       &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Gönder&lt;/button&gt;<br>                     &lt;/form&gt;<br>                 &lt;/div&gt;<br>                 {% if answer %}<br>                 &lt;div class=&quot;card-footer&quot;&gt;<br>                     &lt;h5 class=&quot;text-center&quot;&gt;Cevap&lt;/h5&gt;<br>                     &lt;p class=&quot;text-center&quot;&gt;{{ answer }}&lt;/p&gt;<br>                 &lt;/div&gt;<br>                 {% endif %}<br>             &lt;/div&gt;<br>         &lt;/div&gt;<br>     &lt;/div&gt;<br> &lt;/div&gt;<br> &lt;/body&gt;<br>&lt;/html&gt;</pre><pre><br> body {<br>     background-color: #f5f5f5;<br>     font-family: &#39;Roboto&#39;, sans-serif;<br>     font-size: 16px;<br>     color: #333;<br>     line-height: 1.5;<br>     margin: 0;<br> }<br><br> .container {<br>     max-width: 960px;<br>     margin: 0 auto;<br>     padding: 0 15px;<br> }<br><br> .container h1 {<br>     font-size: 2.5rem;<br>     margin: 30px 0;<br> }<br><br> .container p {<br>     margin-bottom: 15px;<br> }<br><br> .container .btn {<br>     display: inline-block;<br>     padding: 10px 20px;<br>     background-color: #333;<br>     color: #fff;<br>     text-decoration: none;<br>     border-radius: 5px;<br>     transition: all 0.3s ease;<br> }<br><br><br> .container .btn:hover {<br>     background-color: #555;<br> }<br><br> .container .btn:active {<br>     background-color: #555;<br>     transform: translateY(4px);<br> }<br><br> .container .btn-primary {<br>     background-color: #333;<br> }<br><br> .container .btn-primary:hover {<br>     background-color: #555;<br> }</pre><p>Kodu API key ile alakalı teknik problemler yüzünden GitHub içerisinde kapalı tutmak durumunda kaldım ancak basit bir ChatGPT Chatbot’un nasıl yapıldığını paylaşmak istedim. Tabii ki ChatGPT pek daha çok işlevselliğe sahip ancak OpenAI API’sini ve GPT-3 teknolojisini kullanarak basit bir bot yapmak mümkün.</p><p>Veee badice.ai Versiyon 1:</p><p><a href="http://badice.xyz/">http://badice.xyz/</a></p><p>“Uyumalı mıyım?” soruma verdiği cevabı oldukça kaçamak bir cevap bulduğum için yazımı bu yanıtla bitiriyorum. Bir sonraki yazımda görüşmek üzere. 👾</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NqRUKVb665yEyUy1LNiPaQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d0a9b87c02a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Magenta ile Müzik Oluştur!]]></title>
            <link>https://basakdilaraavci.medium.com/magenta-ile-m%C3%BCzik-olu%C5%9Ftur-8bb2353b9036?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bb2353b9036</guid>
            <category><![CDATA[magenta]]></category>
            <category><![CDATA[ai-generated]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[music-generation]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Fri, 06 Jan 2023 02:00:27 GMT</pubDate>
            <atom:updated>2023-01-06T02:00:27.282Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Cv_bEB-eiSXvcfYoopsqkQ.gif" /><figcaption><a href="https://gifer.com/en/BfOJ">Image via GIFER</a></figcaption></figure><h3>Magenta nedir?</h3><p>TensorFlow ile inşa edilen açık kaynaklı bir araştırma projesidir. Hedefi makine öğrenmesinde yaratıcı süreçleri araştırmaktır. Başlangıç seviyesinde bu projeden bahsedeceğim.</p><p>Öncelikle bir sanal ortam kurarak başlayalım. Sanal ortamlar çalışmak istediğimiz projeler için kurulur ve kolaylıkla kaldırılabilir. Projeler arasındaki çakışmalara engel olduğu için sıklıkla kullanılır.</p><pre>py -m venv magenta<br>cd C:\Users\&lt;kullanıcı-adi&gt;\OneDrive\Belgeler\VENV\magenta\Scripts<br>activate magenta</pre><p>Magenta isimli sanal bir ortam oluşturmak Windows PowerShell kullanacağım. Daha sonra bu ortamı aktif hale getireceğim.</p><p>Kurulum hakkında daha ayrıntılı bilgi için Magenta Github sayfasının linkini ekliyorum.</p><p><a href="https://github.com/magenta/magenta">Magenta Github</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*UG7EF8aQ5c0peTQbSgGKKA.gif" /><figcaption><a href="https://giphy.com/explore/mouse-clicking">Image via GIPHY</a></figcaption></figure><p>Daha sonra oluşturduğumuz sanal ortamın dizinine magentayı <em>pip</em> ile yükleyebiliriz.</p><pre>pip install magenta==0.4.0</pre><p>Bir çay, kahve molası verebilirsiniz, zira biraz sürecek. :’)</p><p><em>Buna alternatif olarak, </em><a href="https://github.com/xychelsea/magenta-docker"><em>Docker Container’</em></a><em>ı da tercih edebilirsiniz.</em></p><p>Önceden eğitilmiş modelleri ise <a href="https://github.com/magenta/magenta/tree/main/magenta/models">bu</a> adresten erişerek indirebiliriz.</p><p><strong>Basic RNN</strong></p><p>Basic RNN kullanarak bir müzik oluşturalım:</p><pre>melody_rnn_generate \<br>--config=basic_rnn \<br>--bundle_file=./workspace/magenta-music/basic_rnn.mag \<br>--output_dir=./workspace/magenta-music\ basic \<br>--num_outputs=10 \<br>--num_steps=128 \<br>--primer_melody=&quot;[60]&quot;</pre><p><em>bundle_file</em> ile kullanılacak modelin bulunduğu dosya dizinini belirtebiliriz, <em>output_dir</em> ile çıktılarımızı kaydetmek istediğimiz dizini, <em>num_outputs </em>ile çıktı olarak istediğimizi MIDI dosyası sayısını belirtebiliriz. <em>num_steps</em> ve <em>primer_melody </em>ise oluşturacağımız seslerin özellikleridir. .MID veya .MIDI <a href="https://tr.eyewated.com/dosya-uzantisi-nedir/">d</a>osya uzantısına sahip bir dosya bir Müzik Enstrümanı Dijital Arabirim dosyasıdır. Bu protokol hakkında daha ayrıntılı bilgi edinmek isteyenler için bir video ekliyorum. -&gt; <a href="https://www.youtube.com/watch?v=ZacX5YgUphU&amp;ab_channel=AllianzMottoM%C3%BCzik">MIDI nedir</a>❓</p><pre>&#39;num_steps&#39;:<br>    Üretilen melodilerin olması gereken toplam adım sayısı, priming<br>    melodi uzunluğu ve oluşturulan adımların toplamı. Her adım bir ölçünün<br>    16&#39;da biridir.<br><br>&#39;primer_melody&#39;: <br>    note_seq.Melody event değerlerinin Python listesinin string gösterimi<br>    Örneğin: [60, -2, 60, -2, 67, -2, 67, -2]. Belirtilmişse, bu melodi<br>    priming melodisi olarak kullanılır. Bir priming melodisi <br>    belirtilmemişse, melodiler sıfırdan üretilecektir.</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fflat.io%2Fembed%2F63b7705406877406f6e8065b%3FsharingKey%3De4df5b99c8fd5c641c4466ae69ab5ecebb5def8f2cb3762303945b2f52a65b9ec9c4611e6545104a6726063e63d8d265230e3b996dd4cd5e3359b29b7c57ded9&amp;display_name=Flat&amp;url=https%3A%2F%2Fflat.io%2Fscore%2F63b7705406877406f6e8065b-basic-rnn%3FsharingKey%3De4df5b99c8fd5c641c4466ae69ab5ecebb5def8f2cb3762303945b2f52a65b9ec9c4611e6545104a6726063e63d8d265230e3b996dd4cd5e3359b29b7c57ded9&amp;image=https%3A%2F%2Fflat.io%2Fapi%2Fv2%2Fscores%2F63b7705406877406f6e8065b%2Frevisions%2Flast%2Fthumbnail.png%3FnoRedirect%3Dtrue%26sharingKey%3De4df5b99c8fd5c641c4466ae69ab5ecebb5def8f2cb3762303945b2f52a65b9ec9c4611e6545104a6726063e63d8d265230e3b996dd4cd5e3359b29b7c57ded9&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=flat" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/dcab59f6845735a399794ee2af487308/href">https://medium.com/media/dcab59f6845735a399794ee2af487308/href</a></iframe><p>Oldukça rastgele duruyor, değil mi?</p><p><strong>Lookback RNN</strong></p><p>Lookback RNN modeli ölçü çizgileri arasında tekrar eden örüntüleri yakalayabiliyor. Şimdi bunu deneyelim.</p><pre>melody_rnn_generate \<br>--config=lookback_rnn \<br>--bundle_file=./workspace/magenta-music/lookback_rnn.mag \<br>--output_dir=./workspace/magenta-music/lookback \<br>--num_outputs=10 \<br>--num_steps 80 \<br>--primer-melody=&quot;[60]&quot;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fflat.io%2Fembed%2F63b7757811ea48b2923489fb%3FsharingKey%3D4d3f696cf5c59fa653387c3bdf6780a165eb15a2063ba7637ebbc91011cbbd9c2630577710f7ddff025bb28a2b13a05a8ccfe9b4ff5b4faec3497f3302307398&amp;display_name=Flat&amp;url=https%3A%2F%2Fflat.io%2Fscore%2F63b7757811ea48b2923489fb-default-title%3FsharingKey%3D4d3f696cf5c59fa653387c3bdf6780a165eb15a2063ba7637ebbc91011cbbd9c2630577710f7ddff025bb28a2b13a05a8ccfe9b4ff5b4faec3497f3302307398&amp;image=https%3A%2F%2Fflat.io%2Fapi%2Fv2%2Fscores%2F63b7757811ea48b2923489fb%2Frevisions%2Flast%2Fthumbnail.png%3FnoRedirect%3Dtrue%26sharingKey%3D4d3f696cf5c59fa653387c3bdf6780a165eb15a2063ba7637ebbc91011cbbd9c2630577710f7ddff025bb28a2b13a05a8ccfe9b4ff5b4faec3497f3302307398&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=flat" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f6392e4ec1dcdc6c763a97e2fb16072/href">https://medium.com/media/5f6392e4ec1dcdc6c763a97e2fb16072/href</a></iframe><p>Rastgelelik kayboldu. Artık partisyondaki tekrarları duyabiliyoruz.</p><p><strong>Attention RNN</strong></p><p>Peki ya Lookback RNN Modeli gibi birkaç adım geriye değil de adımların daha büyük bir bütününe bakabilseydik?</p><pre>melody_rnn_generate \<br>--config=attention_rnn \<br>--bundle_file=./workspace/magenta-music/attention_rnn.mag \<br>--output_dir=./workspace/magenta-music/attention \<br>--num_outputs=10 \<br>--num_steps 80 \<br>--primer-melody=&quot;[60]&quot;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fflat.io%2Fembed%2F63b7776f6dd74b0ef6d5f137%3FsharingKey%3De4121e1c5c7c37fd6ffb0114b48a90b9f0641d22007edce3202152d3b13d5d717a4a5b61a0184c3e525b51583941b093dfbc3745b0928d570139f79b4195c9d8&amp;display_name=Flat&amp;url=https%3A%2F%2Fflat.io%2Fscore%2F63b7776f6dd74b0ef6d5f137-attention%3FsharingKey%3De4121e1c5c7c37fd6ffb0114b48a90b9f0641d22007edce3202152d3b13d5d717a4a5b61a0184c3e525b51583941b093dfbc3745b0928d570139f79b4195c9d8&amp;image=https%3A%2F%2Fflat.io%2Fapi%2Fv2%2Fscores%2F63b7776f6dd74b0ef6d5f137%2Frevisions%2Flast%2Fthumbnail.png%3FnoRedirect%3Dtrue%26sharingKey%3De4121e1c5c7c37fd6ffb0114b48a90b9f0641d22007edce3202152d3b13d5d717a4a5b61a0184c3e525b51583941b093dfbc3745b0928d570139f79b4195c9d8&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=flat" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd70bd5bf86f9717c4c751948aeb32d4/href">https://medium.com/media/bd70bd5bf86f9717c4c751948aeb32d4/href</a></iframe><p>İlk ikisine oranla oldukça güzel geliyor kulağa. :)</p><p>Şimdi sıra kendi midi dosyamızdan müzik oluşturmakta.</p><p><a href="https://bitmidi.com/activator-rising-sun-piano-mid"><em>https://bitmidi.com/activator-rising-sun-piano-mid</em></a></p><p>Bu adresten kullanacağım mid uzantılı dosyayı indiriyorum.</p><p>Primer melodi yerine kendi seçtiğimiz midi dosyasını <em>primer_midi</em> olarak yerleştirerek müziği oluşturabiliriz.</p><pre>melody_rnn_generate <br>--config=attention_rnn <br>--bundle_file=./workspace/magenta-music/attention_rnn.mag <br>--output_dir=./workspace/magenta-music/activator-generated<br>--num_outputs  20  <br>--num_steps 128 <br>--primer_midi=./workspace/magenta-music/rising-sun.mid</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fflat.io%2Fembed%2F63b77bd70b0203f3679fc350%3FsharingKey%3D74b30a129d8d8182d8045726ae18b33d20265924940751b02e807063e4b84d369817ad1bdc7c315c28844d64396c92da8d0440e7301b352d2900507479b4fdd9&amp;display_name=Flat&amp;url=https%3A%2F%2Fflat.io%2Fscore%2F63b77bd70b0203f3679fc350-sun-rising%3FsharingKey%3D74b30a129d8d8182d8045726ae18b33d20265924940751b02e807063e4b84d369817ad1bdc7c315c28844d64396c92da8d0440e7301b352d2900507479b4fdd9&amp;image=https%3A%2F%2Fflat.io%2Fapi%2Fv2%2Fscores%2F63b77bd70b0203f3679fc350%2Frevisions%2Flast%2Fthumbnail.png%3FnoRedirect%3Dtrue%26sharingKey%3D74b30a129d8d8182d8045726ae18b33d20265924940751b02e807063e4b84d369817ad1bdc7c315c28844d64396c92da8d0440e7301b352d2900507479b4fdd9&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=flat" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7db429c157ac51672f62ec31c1e8e1b/href">https://medium.com/media/e7db429c157ac51672f62ec31c1e8e1b/href</a></iframe><p>Aralarında en başarılısı bu sanırım. :’)</p><p>Giriş seviyesinde açıkladığım Magenta ile yapabileceğiniz fazlasıyla enteresan şeylere <a href="https://magenta.tensorflow.org/demos">demos </a>sayfasından bakabilirsiniz. Bir sonraki yazımda görüşmek üzere. 🦊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bb2353b9036" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenCV ile Görüntü İşlemeye Giriş]]></title>
            <link>https://basakdilaraavci.medium.com/opencv-ile-g%C3%B6r%C3%BCnt%C3%BC-i%CC%87%C5%9Flemeye-giri%C5%9F-84f6429438cd?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/84f6429438cd</guid>
            <category><![CDATA[masking]]></category>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[rotation]]></category>
            <category><![CDATA[image-binarization]]></category>
            <category><![CDATA[image-processing]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Thu, 29 Dec 2022 17:39:07 GMT</pubDate>
            <atom:updated>2022-12-29T17:39:07.782Z</atom:updated>
            <content:encoded><![CDATA[<p>IDE ve environment tercihi size kalmış ancak sıfırdan başlayanlar için hızlıca giriş yapmak istiyorum. Ben Spyder kullanacağım. <strong>Spyder</strong>, Python ile yazılmış açık kaynak bir IDE’dir.</p><p>Alakalı kütüphaneleri yükleyerek başlayalım. OpenCV için iki adet kütüphane bulunmaktadır. Birisi resmi OpenCV kütüphanesi, diğeri ise katkıda bulunabileceğimiz biraz daha değişken olan OpenCV contrib kütühanesi. Daha güncel özelliklerden faydalanmak için <em>contrib</em> olanı yükleyeceğim.</p><p>İlk olarak yeni bir environment yaratıp yorumlayıcımızı değiştirelim.</p><p>Yeni bir environment yaratmak için kullanmamız gereken Anaconda komutu:</p><pre>conda create --name opencvenv python</pre><p>‘y’ ile onayladıktan sonra opencvenv adlı <em>environment</em>ı aktif hale getirebiliriz ve <em>pip </em>kulllanarak OpenCV kütüphanesini indirebiliriz.</p><pre>conda activate opencvenv<br>pip install opencv-contrib-python<br>pip install spyder</pre><p>Spyder’da <em>Tools&gt;Preferences&gt;Python interpreter </em>alanından oluşturduğumuz environment içindeki Python yorumlayıcısını seçelim.</p><p>Başlamaya hazırız. Doğru dizinde olduğumdan emin olduktan sonra tabii… :’)</p><pre>import cv2</pre><p>Aşağıdaki görseli kaydedelim veya benzeri bir görseli bulup aynı dizine kaydedelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*E2x74AYHa9D5AcGdx2LuJA.png" /></figure><p>logo.png isimli bu görseli yeni bir isimle aynı dizine yeniLogo.png olarak yazmak için önce görseli <em>img </em>olarak okutabiliriz.</p><pre>img = cv2.imread(&quot;logo.png&quot;)<br>cv2.imwrite(&quot;yeniLogo.png&quot;, img)</pre><p>Logoyu farklı bir pencerede görebilmek için imshow ile pencereyi çağıralım. Açılan pencereden sorunsuz çıkabilmek için destroyAllWindows() fonksiyonunu ekleyelim.</p><pre>cv2.imshow(&#39;logo penceresi&#39;, img)<br><br>cv2.waitKey(0)<br>cv2.destroyAllWindows()    </pre><h3>Gri Tonlama</h3><p>Logoyu gri tonlamaya çevirmek için iki benzer yöntemden bahsedeceğim.</p><p><em>1. Yöntem</em></p><p>Bu yöntem ile görseli doğrudan gri tonlamaya çevirerek okutmak mümkündür.</p><pre>img = cv2.imread(&quot;logo.png&quot;, cv2.IMREAD_GRAYSCALE)</pre><p><em>2. Yöntem</em></p><p>Bu yöntem ile önceden img olarak okuttuğumuz renkli görseli gri tonlamaya çevirebiliriz. Bu şekilde iki versiyonuna da erişimimiz olacaktır.</p><pre>img = cv2.imread(&quot;logo.png&quot;)<br>grayImg = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)<br>cv2.imshow(&#39;logo penceresi&#39;, grayImg)<br><br>cv2.waitKey(0)<br>cv2.destroyAllWindows()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*n6uTyiIJeVKnhkv78PEE9g.png" /></figure><h3>Binarize Etme Yöntemleri (Binarization)</h3><p>Dilimize bu şekilde çevirdiğim için üzgünüm.😅Eğer terimin doğru Türkçe karşılığını biliyorsanız bana ulaşmaktan çekinmeyin. En basit haliyle gri tonlama uyguladığımız görseli siyah-beyaz hale çevirmek olarak düşünebiliriz.</p><p>Görüntü eşikleme denilen bir yöntem kullanarak bu işlemi gerçekleştirebiliriz.</p><blockquote><a href="https://tr.wikipedia.org/wiki/G%C3%B6r%C3%BCnt%C3%BC_e%C5%9Fikleme">Dijital görüntü işlemede, eşikleme, görüntüleri bölümlere ayırmada kullanılan bir yöntemdir. Görüntülere gri tonlama eklendikten sonra ikili (binary) bir görüntü elde edilir. İkili görüntüler oluşturmak için eşikleme kullanılabilir</a>.</blockquote><p>Aşağıdaki kod ile gri tonlama uyguladığımız görseldeki 0 pikselli her karenin 0 yani siyah kalmasını ve buna uymayan piksellerin beyaza dönüştürülmesini sağlıyoruz.</p><pre>ret, thresh = cv2.threshold(grayImg, 0, 255, cv2.THRESH_BINARY)</pre><p>NumPy kullanarak iki görselin benzersiz değerlerini inceleyebiliriz.</p><pre>grayImg = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)<br>gray_np = np.array(grayImg)<br>print(np.unique(gray_np))<br><br>ret, thresh = cv2.threshold(grayImg,0,255, cv2.THRESH_BINARY)<br>binary_np = np.array(thresh)<br>print(np.unique(binary_np))</pre><pre>Output:<br>[  0   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  19  20<br>  21  23  24  26  27  28  29  30  31  35  36  38  39  41  44  46  47  48<br>  52  54  56  59  62  65  68  69  72  73  75  76  80  84  86  91 100 105<br> 106 114 115 120 125 127 135 140 150 151 159 174 181 193 199 214 221 229<br> 246 251 255]<br>[  0 255]</pre><p>Gri tonlamalı versiyonunda değerler 0 ile 255 arasında değişirken, binarize edilmiş versiyonunda sadece 0 ve 255 benzersiz değerlerini gözlemliyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*TCTwZ0S1WsPUty_74S7oqA.png" /></figure><h3>Görüntü Döndürme</h3><p>Derin öğrenme modelleri daha fazla veri ile daha iyi eğitildiği için Veri Artırımı (Data Augmentation) denilen bir teknik kullanılmaktadır. Görüntü Döndürme işlemi veri sayısını ciddi oranlarda arttırabilmektedir. Örneğin kedileri tanımak için eğittiğiniz bir modelde sağa döndürülmüş düz duran kedi resimleri sayesinde gerçekten sağa yatmış kedilerin fotoğrafları olmadan bir modeli başarılı bir şekilde eğitmemiz mümkündür.</p><p>Görselin farklı yönlere döndürülmüş kopyalarını oluşturalım.</p><pre>rot1 = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE) #örnek<br>rot2 = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)<br>rot3 = cv2.rotate(img, cv2.ROTATE_90_COUNTERCLOCKWISE)<br>rot4 = cv2.rotate(img, cv2.ROTATE_180_COUNTERCLOCKWISE)<br>cv2.imshow(&#39;logo penceresi&#39;, rot1)<br>cv2.imshow(&#39;logo penceresi&#39;, rot2)<br>cv2.imshow(&#39;logo penceresi&#39;, rot3)<br>cv2.imshow(&#39;logo penceresi&#39;, rot4)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/178/1*fPJdL6acJgRBd6rxetT9fg.png" /><figcaption>Örnek</figcaption></figure><ul><li>NumPy ile rastgele bir veri oluşturup OpenCV formatına dönüştürmek ve görüntülemek için NumPy default_rng ile rastgele oluşturduğumuz sayıları bir array halinde OpenCV’de tanımlayabiliriz.</li></ul><pre>from numpy.random import default_rng<br><br>img = np.random.default_rng().integers(2, size=(300,300), dtype=np.uint8)<br>img = np.array(img*255)<br>cv2.imshow(&#39;logo penceresi&#39;, img)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*8EioMJAvLZ7RsAwfEsLUmA.png" /></figure><h3>İstiflenmiş Görünü (Stacking Display)</h3><p>np.zeros Python işlevi, sıfırlarla dolu bir matris oluşturmak için kullanılır. np.full ise matrisi verdiğimiz değerle doldurmak için kullanılır. Bunları kullanarak bir beyaz ve bir siyah görsel oluşturup ayrı pencerelerde kontrol edelim.</p><pre>image1 = np.zeros((50, 50), np.uint8)<br>cv2.imshow(&quot;siyah görsel&quot;, image1)<br>image2 = np.full((50, 50), 255, np.uint8)<br>cv2.imshow(&quot;beyaz görsel&quot;, image2)</pre><p>Dikey olarak görüntülemek için:</p><pre>stacked_vertical = np.vstack((image1, image2))<br>stacked_vertical = np.array(stacked_vertical, np.uint8)<br>cv2.imshow(&quot;Dikey&quot;, stacked_vertical)</pre><p>Yatay olarak görüntülemek için:</p><pre>stacked_horiz = np.hstack((image1, image2))<br>stacked_horiz = np.array(stacked_horiz, np.uint8)<br>cv2.imshow(&quot;Yatay&quot;, stacked_horiz)</pre><h3>Kontur</h3><p>Kontur, bir resimde nesneleri belirgin gösteren çevre çizgilerine verilen addır. Şekillerin analizinde ve nesne tanıma alanlarında konturlarla sıklıkla çalışılır. Eğer nesnenin çevre çizgilerini bulabilirsek basit bir sınıflandırma ile bunun aradığımız obje olup olmadığını tespit edebiliriz.</p><p>Kontur çıkarımı işlemini gerçekleştirmek için önce bir ön işlemeden geçirmek gerekmektedir. Çünkü konturların tespit edilebilmesi için arka planın doğru bir şekilde tespit edilmesi gerekir. Eğer arka plan ile nesne arasındaki kontrast farkı yüksekse arka plan ve nesne kolaylıkla tespit edilebilir. Dolayısıyla ön işleme ile yüksek bir kontrast yaratmaya çalışırız.</p><p>Yukarıda gösterdiğim gibi görseli gri tonlamaya çevirirsek ve binarize edersek ön işlemeyi yapmış sayılırız.</p><p>Konturları, konturların arasında olmasını istediğimiz ilişkiye göre ve konturların çıkarımını yaparken kullanmak istediğimiz yöntemi belirterek konturların değerlerini çıkarabiliriz.</p><pre>contour, h = cv2.findContours(thresh, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)</pre><p>Konturları ile beraber görseli çizmek için ise konturlarını çizmek istediğimiz görsel, kontur değerleri, tüm indeksi almak için -1 değerini, kontur çizgilerinin rengini belirtmek için (255, 0 , 255), ve çizginin kalınlığını belirtmek için 1 değerini vererek aşağıdaki kodu kullanabiliriz.</p><pre>cv2.drawContours(img, contours, -1, (255, 0, 255), 1)<br><br>cv2.imshow(&#39;logo penceresi&#39;, img)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*78CI_7pU-M8anr1YAJgDLw.png" /></figure><p>Konturları başka bir görsele yerleştirmek için biraz daha farklı bir yöntem uygulamamız gerekiyor.</p><pre><br>image_list=[]<br>for i, cnt in enumerate(contours):<br>    im = np.zeros((img.shape[0], img.shape[1]), np.uint8) #Boş görselin boyutu <br>    cv2.drawContours(im, [cnt], -1, (255, 255, 255), -1)<br>    image_list.append(im)<br><br>imtoshow1 = np.hstack((image_list[0:7]))<br>imtoshow2 = np.hstack((image_list[7:13]))<br><br>cv2.imshow(&#39;logo penceresi 1&#39;, imtoshow1)<br>cv2.imshow(&#39;logo penceresi 2&#39;, imtoshow2)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4tpsPp_vxP9isyFafEv3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*elyBKX8bpLr1sdieK-I5jw.png" /></figure><h3>Örtüleme</h3><p>Görseldeki bazı bölümleri diğer bölümlerden ayrıştırmak için kullanılan bir tekniktir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OObobaN0TCj99bZ168YCdw.jpeg" /><figcaption><a href="https://automaticaddison.com/how-to-apply-a-mask-to-an-image-using-opencv/">Image via https://automaticaddison.com/</a></figcaption></figure><p>Eğer maske ve orijinal resimdeki piksel 1 değerine sahipse çıktı görselde de 1 değeri elde edileceği için görselde nesne ayrıştırılabilir.</p><p>Konturları çıkardığımız kodu biraz güncelleyelim ve maskelenmiş görsellere erişelim.</p><pre>image_list=[]<br>masked_images=[]<br>for i, cnt in enumerate(contours):<br>    area = cv2.contourArea(cnt)<br>    if area &gt; 25:<br>        im = np.zeros((img.shape[0], img.shape[1]), np.uint8)  <br>        cv2.drawContours(im, [cnt], -1, (255, 255, 255), -1)<br>        image_list.append(im)<br>        <br>        masked = cv2.bitwise_and(img, img, mask=im)<br>        masked_images.append(masked)<br><br>bound1 = int(len(image_list)/2)<br>bound2 = len(image_list) +1<br><br>imtoshow1 = np.hstack((masked_images[0 : bound1]))<br>imtoshow2 = np.hstack((masked_images[bound1 : bound2]))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VdFdNQGc79Yuf6R1p2Svtw.png" /></figure><p>Eğer harfleri tek tek kaydetmek istersek <em>for</em> döngüsünün sonuna aşağıdaki kodu eklememiz yeterli olacaktır.</p><pre>cv2.imwrite(&quot;letter&quot;+str(i)+&quot;.jpg&quot;, masked)</pre><p>Geçtiğimiz ay, kenar algılama işlemini kendi fotoğrafıma uygulamıştım. Bu görseli paylaşarak yazıyı sonlandırıyorum. Daha sonra bununla ilgili de bir yazı yazmayı planlıyorum. Şimdilik, sağlıklı günler dilerim!☺️☺️☺️☺</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*YAEXbGdLK6VF-tb5NsuXWQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84f6429438cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#9 Python: Nesne Yönelimli Programlama (OOP)]]></title>
            <link>https://basakdilaraavci.medium.com/9-python-nesne-y%C3%B6nelimli-programlama-oop-c778fdc6035f?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c778fdc6035f</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[oop-concepts]]></category>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[oop]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Thu, 24 Nov 2022 08:34:46 GMT</pubDate>
            <atom:updated>2022-11-24T08:36:51.855Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ceSB_jCX8yMniX3hRx4Opg.gif" /><figcaption>Image via <a href="https://www.usertesting.com/blog/better-landing-page-experience">Link</a></figcaption></figure><p>Merhaba, SistersLab’in Toplum Gönüllüleri Vakfı (TOG) tarafından desteklenen Women in Tech Academy proje katılımcılarından biriyim. Proje, 20–28 yaş aralığında beyanı kadın olan bireyleri 3 ay boyunca yazılım eğitimi ve destekleyici eğitimlerle güçlendirerek sektörde iş gücüne katılımını artırmayı hedefliyor. Projeyle ilgili detaylı bilgiye bu bağlantıdan ulaşabilirsiniz: <a href="https://sisterslab.co/women-in-tech-academy/">Women in Tech Academy</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*-AP6aX1aw2stfKI2Qg1urg.jpeg" /></figure><p>Merhabalar. Akademi boyunca aldığımız Python eğitimlerini derleyip sizlerle paylaşacağım. Kendi bilgilerimin kalıcılığını yükseltmenin yanı sıra bilgilerin paylaştıkça çoğaldığına inanan biri olarak hem bilgi akışına hem de Türkçe kaynaklara desteğimi sağlamayı hedefliyorum.</p><p><strong>Programlar ne işe yarar?</strong></p><p>Komut satırları ve işletim sistemleri aracılığıyla işlerimizi kolaylaştıran araçlardır diyebiliriz. Programlar hayatımızın her alanına işlemiş durumdadır.</p><p><strong>Programlama Paradigmaları</strong></p><p>Amacımıza bağlı olarak farklı programlama dilleri ve farklı yaklaşımlar tercih edilir.</p><ul><li>Emirli Programlama <em>(Imperative)</em></li></ul><p>-&gt; Prosedürel Programlama <em>(Procedural Programming)</em></p><p>-&gt; Yapısal Programlama<em> (Structured Programming)</em></p><p>-&gt; Nesne Yönelimli Programlama <em>(Object Oriented Programming)</em></p><ul><li>Bildirimli Programlama <em>(Declarative)</em></li></ul><p>-&gt; Fonksiyonel Programlama <em>(Functional Programming)</em></p><p>-&gt; Mantıksal Programlama <em>(Logic Programming)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dRa8731ni9MmSwFnjJbr7g.jpeg" /></figure><p>Paradigma yaklaşım. en popüler yaklaşım OOP. kurgu farklılığı oluyor. Nesne Yönelimli Programlama<em> (Object Oriented Programming) </em>sınıflar ve nesneler kavramlarına odaklanan bir programlama paradigmasıdır. Nesne Yönelimli Programlama’nın Python’da temel ilkeleri kapsülleme, kalıtım, çok biçimlilik ve soyutlama olarak belirtilebilir. Bir programlama diline nesne yönelimli diyebilmemiz için bu ilkeleri sağlayıp sağlamadığına bakarız.</p><ul><li><strong>Kapsülleme<em> (Encapsulation): </em></strong>Bir sınıfa ait niteliklerin sadece bu sınıfa ait metotlar tarafından değiştirilebilmesi ve okunabilmesiyle alakalı ilkesidir.</li><li><strong>Kalıtım <em>(Inheritance): </em></strong>Bir sınıfın başka bir sınıftan kalıtım yapması, kalıtımı yapan sınıfın kalıtım yapılan sınıfın nitelik ve davranışlarını miras almasıdır. Nesne Yönelimli Progralamada 4 adet kalıtım türü vardır.</li><li><strong>Çok Biçimlilik <em>(Polymorphism):</em></strong> Nesne Yönelimli Programlamada programlama dilinin, farklı tip verileri ve sınıfları farklı bir şekilde işleme kabiliyetidir. Metotlarda üzerine yazma<em> ( method overriding) </em>özelliği sayesinde bir alt sınıfın içerisinde doğrudan veya dolaylı ata sınıflardan gelen bir veya daha fazla metodun aynı ad ve parametre listesi ile kodlanabilmesi mümkündür. Bu da çok biçimliliği mümkün kılmaktadır.</li><li><strong>Soyutlama<em> (Abstraction): </em></strong>Bir sınıf içerisinden nesne üretilmesini istemediğimiz zaman bunu engellememizi sağlayan ilkedir. Bir sınıfa veya metoda temel görevleri tanınır ancak detaylar tanımlanmaz.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWoBj6HgzEnF6uWtMqUuWQ.png" /></figure><p>Bir araba sınıfı tanımlayalım ve plaka, vites tipi, marka ve renk olmak üzere niteliklerini belirtelim:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed4eb9611d5ba2ccf9ea03aaf50dc106/href">https://medium.com/media/ed4eb9611d5ba2ccf9ea03aaf50dc106/href</a></iframe><p>Nesnelerdeki mantık ise günlük hayatta kullandığımız nesne tanımına benzemektedir. Masa, bilgisayar, araba gibi programlama paradigmalarından OOP’de her şeye nesne niteliğinde yaklaşılır. Her nesnenin bir durumu, bir davranışı ve bir kimliği vardır.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/746941ac1911d7e3775b086b1eef1d49/href">https://medium.com/media/746941ac1911d7e3775b086b1eef1d49/href</a></iframe><p>Oluşturduğumuz sınıftan hızlıca yeni bir araba markası kaydedip kolaylıkla erişebiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3bf15e61cadbcb977e5ba3209ce5086a/href">https://medium.com/media/3bf15e61cadbcb977e5ba3209ce5086a/href</a></iframe><pre>06 PYTHON 35</pre><p>Aynı sınıfı kullanarak başka bir araba grubu oluşturabiliriz ve niteliklerine erişebiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4b83f992d5a3437484d25e55eb11f6c/href">https://medium.com/media/a4b83f992d5a3437484d25e55eb11f6c/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b2ac14860f6625d8da6bf5166a15ea6/href">https://medium.com/media/4b2ac14860f6625d8da6bf5166a15ea6/href</a></iframe><pre>&#39;Manuel&#39;</pre><p><em>fiat </em>arabasının tipine baktığımızda sınıf olduğunu görebiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3496db83baa981c0c3e35786ebc1f56e/href">https://medium.com/media/3496db83baa981c0c3e35786ebc1f56e/href</a></iframe><pre>&lt;class &#39;__main__.Araba&#39;&gt;</pre><p>Sınıflara özellik tanımlayabildiğimiz gibi işlev (<em>method) </em>tanımlayabiliriz.</p><p><em>km_arttir() </em>işlevini <strong>Araba</strong> sınıfına ekleyelim.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/beddf0ce1d8bd05738d314b2b1a4126b/href">https://medium.com/media/beddf0ce1d8bd05738d314b2b1a4126b/href</a></iframe><p>Bu işlevi çağırarak kolayca kullanabiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/65fd08ebb12db93cf8039555e7f4d5da/href">https://medium.com/media/65fd08ebb12db93cf8039555e7f4d5da/href</a></iframe><pre>100</pre><p>__init__() ile nesne oluştururuz, böylelikle sınıfın niteliklerine erişebiliriz. Yeniden oluşturmamıza gerek kalmadığı için kolaylık sağlar.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c6e6d1c7d08045668a6ed708f74d674/href">https://medium.com/media/9c6e6d1c7d08045668a6ed708f74d674/href</a></iframe><p>Sınıfın niteliklerini ve işlevini kullanalım:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8bcc745c7179d8fca7e81760f3e9895d/href">https://medium.com/media/8bcc745c7179d8fca7e81760f3e9895d/href</a></iframe><pre>90</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/355bca56465c4099777c503044b00a41/href">https://medium.com/media/355bca56465c4099777c503044b00a41/href</a></iframe><pre>Arabamızın özellikleri:  <br>Marka: Fiat <br>Plaka: 06 BC 35 <br>Vites: Otomatik <br>Rengi: Beyaz</pre><p>Eğer sınıfa kalıtım yaptırmadan nesnenin niteliğini kullanmaya çalışırsak hata alırız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/adf9b00c56d8811c4670e26b29dd0042/href">https://medium.com/media/adf9b00c56d8811c4670e26b29dd0042/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f553b2ab17d35215b1de8337b4607ea/href">https://medium.com/media/2f553b2ab17d35215b1de8337b4607ea/href</a></iframe><pre>--------------------------------------------------------------------AttributeError                            <br>Traceback (most recent call last) <br>Cell In [20], line 2       <br>      1 tpm = Personel(&quot;Şeyma&quot;, &quot;TCSEYMA&quot;, 10000, &quot;ICT&quot;) <br>----&gt; 2 tpm.__maas  AttributeError: &#39;Personel&#39; object has no attribute &#39;__maas&#39;</pre><p>Personel sınıfı tanımlayalım ve yeni maaşı belirleyebilmek için nesnede tanımlayalım.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44c994b04ddb8db093f285165c06c3d6/href">https://medium.com/media/44c994b04ddb8db093f285165c06c3d6/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f9679a1b2f62146df0f208f2284a7c4/href">https://medium.com/media/2f9679a1b2f62146df0f208f2284a7c4/href</a></iframe><pre>20000 <br>25000</pre><p><strong>super()</strong> ile üst sınıfın niteliklerini miras alabiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4e8c65e68cec08a13043ebbd3e4b52b/href">https://medium.com/media/d4e8c65e68cec08a13043ebbd3e4b52b/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/808347f811086b9213eb858f20b338eb/href">https://medium.com/media/808347f811086b9213eb858f20b338eb/href</a></iframe><pre>Personel Classı oluşturuldu <br>Insource classı oluşturuldu</pre><p>Sınıfı soyutlayabilmek için soyut bir sınıf oluşturabiliriz. Bunu @abstractmethod ile yaparız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/99d4a7fafac1a4e3606b69cdc94c1841/href">https://medium.com/media/99d4a7fafac1a4e3606b69cdc94c1841/href</a></iframe><p>Görüldüğü üzere OOP karmaşık sistemler oluşturmak ve yönetmek için ideal bir programlama paradigmasıdır.</p><p>Bununla ilgili <a href="https://medium.com/u/9ed172d44ff">Patika.dev</a> ödevlerinden yola çıkarak OOP ile ilgili yaptığım çalışmalar:</p><p><a href="https://github.com/badicev/womenintech_akademi_odev/blob/main/%237-1%20Ucus-Yonetim-Sistemi.ipynb">1-) Uçuş Yönetim Sistemi</a></p><p>2–) <a href="https://github.com/badicev/womenintech_akademi_odev/blob/main/%237-2%20Online-Film-Sistemi.ipynb">Online Film Sistemi</a></p><p>3-) <a href="https://github.com/badicev/womenintech_akademi_odev/blob/main/%237-3%20Asansor-Simulasyonu.ipynb">Asansör Simülasyonu</a></p><p>Ve serinin sonuna geldik. Python konusunda epey yol aldık, okuyan, alkışlayan herkese bolca teşekkür ederim. Umarım faydalı bir yazı serisi olmuştur. İlerleyen zamanlarda Python Lambda ve bazı kütüphanelerden de bahsetmeyi planlıyorum.😊🦊</p><figure><a href="http://clipart-library.com/clipart/ki8nKMXeT.htm"><img alt="" src="https://cdn-images-1.medium.com/max/800/1*cl_gG0ov6CNz-ZmZiLQ-7w.gif" /></a><figcaption>Image via <a href="http://clipart-library.com/clipart/ki8nKMXeT.htm">Clipart Library</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c778fdc6035f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#8 Python: Dosya İşlemleri]]></title>
            <link>https://basakdilaraavci.medium.com/8-python-dosya-i%CC%87%C5%9Flemleri-3f8c097e64c1?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f8c097e64c1</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[file-operations]]></category>
            <category><![CDATA[python-file-handling]]></category>
            <category><![CDATA[files]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Mon, 07 Nov 2022 06:06:22 GMT</pubDate>
            <atom:updated>2022-11-07T06:06:22.744Z</atom:updated>
            <content:encoded><![CDATA[<p>Merhaba, SistersLab’in Toplum Gönüllüleri Vakfı (<a href="https://www.tog.org.tr/">TOG</a>) tarafından desteklenen Women in Tech Academy proje katılımcılarından biriyim. Proje, 20–28 yaş aralığında beyanı kadın olan bireyleri 3 ay boyunca yazılım eğitimi ve destekleyici eğitimlerle güçlendirerek sektörde iş gücüne katılımını artırmayı hedefliyor. Projeyle ilgili detaylı bilgiye bu bağlantıdan ulaşabilirsiniz: <a href="https://sisterslab.co/women-in-tech-academy/">Women in Tech Academy</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*-AP6aX1aw2stfKI2Qg1urg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*JzNanVKvgR9oFah2Q9vj-A.gif" /><figcaption>Image via <a href="https://giphy.com/stickers/transparent-JapxcSwIOMQXbv8Hd5">Giphy</a></figcaption></figure><p>Merhabalar. Akademi boyunca aldığımız Python eğitimlerini derleyip sizlerle paylaşacağım. Kendi bilgilerimin kalıcılığını yükseltmenin yanı sıra bilgilerin paylaştıkça çoğaldığına inanan biri olarak hem bilgi akışına hem de Türkçe kaynaklara desteğimi sağlamayı hedefliyorum.</p><h3>Dosyalama İşlemleri</h3><p>Dosyalama işlemleri dediğimizde yapabileceğimiz birkaç alternatifimiz bulunmaktadır. Hangi amaçla dosyayla etkileşim haline girdiğimize hangisini kullanmamız gerektiği değişecektir.</p><p>Bunlar;</p><ul><li>Dosyayı açma</li><li>Dosyadan veri okuma</li><li>Dosyaya yazma</li><li>Dosya kapatma</li></ul><p>şeklinde maddelenebilir.</p><pre>open(“dosya_yolu”, “erisim_modu”)</pre><ul><li>w -&gt; Dosyayı yazma amacıyla açar. Bir dosya zaten varsa dosyanın üzerine yazar.</li><li>a -&gt; Ekleme modunda dosyayı açar. Dosyanın sonuna yeni satırları ekler.</li></ul><p>Bu işlemleri iki şekilde yapmak mümkündür. İlki dosyayı açarak üzerinde işlem yapmamızı gerektirirken ikincisi <strong><em>with</em></strong> ile kapatmaya gerek olmadan işlemi yapmamızı sağlar.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/13dc62ad9c496cf231b35bfccacfccad/href">https://medium.com/media/13dc62ad9c496cf231b35bfccacfccad/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*upQnbA2B_X5Q8EVD22NDNA.png" /></figure><p>Bazı ayların ismini içeren <em>aylar.txt </em>şeklinde bir dosya oluşturmak için <strong>‘w’ </strong>kullanımı aşağıdaki gibidir:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/acefcdf7c467010c5aec063d0df51287/href">https://medium.com/media/acefcdf7c467010c5aec063d0df51287/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*1zuTrRF5R7CCk7CZDi8Fcg.png" /></figure><p>Bu yazının sonuna ‘Haziran’ ayını eklemek için<strong> ‘a’</strong> kullanırız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6e2ff764140269dea59ef8f68a770e59/href">https://medium.com/media/6e2ff764140269dea59ef8f68a770e59/href</a></iframe><p>Burada yazdıklarımızın yan yana olduğunu fark etmişsinizdir. Bir listeyi <strong>for</strong> döngüsü ve <strong>‘w’</strong> kullanarak dosyada alt alta yazdırabiliriz. <em>‘\n’ </em>döngünün içerisinde her satır sonunda yeni satıra geçmesi için komut vermemiz yeterli olacaktır.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/940bfe5d63d046bd129291fca3e18b88/href">https://medium.com/media/940bfe5d63d046bd129291fca3e18b88/href</a></iframe><p>Dosyalama işlemleri ile uğraşırken belki de en önemli konulardan biri <strong>dizin</strong>dir. Bilgisayarlarda <a href="https://tr.wikipedia.org/wiki/Dizin_(bilgisayar)#:~:text=Bilgisayarlarda%20dizin%20ya%20da%20klas%C3%B6r,da%20alt%2Dklas%C3%B6r%20ad%C4%B1%20verilir."><strong>dizin</strong> ya da <strong>klasör</strong></a>, <a href="https://tr.wikipedia.org/w/index.php?title=Dosya_sistemi&amp;action=edit&amp;redlink=1">dosya sisteminde</a> diğer <a href="https://tr.wikipedia.org/wiki/Dosya">bilgisayar dosyalarına</a> referans kayıtları tutan bir kataloglama yapısıdır. Bulunduğumuz konuma bu yapıyı kullanarak erişiriz.</p><p><strong>os.listdir()</strong> ile bulunduğumuz konumdaki dosyaları incelemek mümkündür.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/76851b2f4aa5d6725139c701dd47e5da/href">https://medium.com/media/76851b2f4aa5d6725139c701dd47e5da/href</a></iframe><pre>[&#39;.git&#39;, &#39;.gitignore&#39;,&#39;aylar.txt&#39;, &#39;aylar2.txt&#39;,&#39;README.md&#39;]</pre><p>Aynu şekilde bulunduğumuz konumda <em>‘aylar.txt’</em> diye bir metin dosyasının bulunup bulunmadığını kontrol etmek de mümkündür. Az önce oluşturduğumuz dosya için <strong>true</strong> dönüşünü alırız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b41fa22bb65083e49c5ffe68bcd4e32/href">https://medium.com/media/9b41fa22bb65083e49c5ffe68bcd4e32/href</a></iframe><pre>True</pre><p>Olmayan <em>‘yıllar.txt’ </em>metin dosyasını arattığımızda ise<strong> false</strong> dönüşünü alırız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc01be2d2dfd082f96fa0eb8a96262f0/href">https://medium.com/media/dc01be2d2dfd082f96fa0eb8a96262f0/href</a></iframe><pre>False</pre><p><strong>Farklı bir dizinde dosya yazdırmak</strong></p><p>Başka bir dizinde yeni bir metin dosyası yazmamız için yolunu belirlip aynı işlemi yapmamız yeterli olacaktır.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee2fc70dbca7d3dc2cd11a602070a4fe/href">https://medium.com/media/ee2fc70dbca7d3dc2cd11a602070a4fe/href</a></iframe><p>İkinci yöntem ile şu şekilde yapabiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7ad06d097a1eeca889fd7021c7df02d/href">https://medium.com/media/f7ad06d097a1eeca889fd7021c7df02d/href</a></iframe><ul><li><strong>datetime</strong> modülü ile belirli aralıklarla çalışan bir kodun, her seferinde o anın tarih ve saat bilgilerini alarak bir dosya oluşturalım.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/837c18ad49df5e73437fe61e58043010/href">https://medium.com/media/837c18ad49df5e73437fe61e58043010/href</a></iframe><p>-&gt; İlk parçada doğrudan ekrana yazdırıyoruz.</p><p>-&gt; İkinci parçada bir dosyaya yazdırıyoruz.</p><p>-&gt; Üçüncü parçada farklı bir format kullanarak başka bir dosyaya yazdırıyoruz.</p><p>-&gt; Dördüncü parçada farklı bir dizinde tarih ve saati yazdırmasını sağlıyoruz.</p><pre>Şimdi:  2022-11-03 09:00:39.398561<br>Gün ay yıl:  03-11-2022 <br>Gün ay yıl saat  03-11-2022 09:00:39 <br>Farklı dizinde gün ay yıl saat 03-11-2022 09:00:39</pre><h3><strong>Dosya Okuma</strong></h3><ul><li>r -&gt; Dosyayı okuma amacıyla açar. Eğer böyle bir dosya yoksa hata verir.</li></ul><p>Daha önceden oluşturduğumuz <em>aylar.txt </em>dosyasını okutmak için:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/60ba9e26a5687bc888f65866ad5c6d9a/href">https://medium.com/media/60ba9e26a5687bc888f65866ad5c6d9a/href</a></iframe><pre>OcakŞubatMartNisanMayısHaziran</pre><p><em>yıllar.txt</em> adında daha önceden açmadığımız bir dosyayı okumaya çalıştığımızda hata alırız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a71f4f3cf7a79cb2e22e02cdc9cb9f95/href">https://medium.com/media/a71f4f3cf7a79cb2e22e02cdc9cb9f95/href</a></iframe><pre>--------------------------------------------------------------------FileNotFoundError                      <br>Traceback (most recent call last) Cell In [31], line 2       <br>     1 #var olmayan bir dosyayı okumaya çalıştığımızda hata alırız. <br>----&gt;2 with open(&quot;yıllar.txt&quot;, &quot;r&quot;) as f:       <br>     3     print(f.read())</pre><pre>FileNotFoundError: [Errno 2] No such file or directory: &#39;yıllar.txt&#39;</pre><p>Eğer bu durumla karşılaşmak istemiyorsak, özellikle büyük projelerde çalışırken<em> if-else </em>yardımı alabiliriz.</p><p>Önce dosyanın var olup olmadığını kontrol edip var ise okuma komutu verip yoksa bu dosyanın var olmadığı bilgisini vermesini isteyebiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df73fb28909e2c65c9808ad37ea4c62a/href">https://medium.com/media/df73fb28909e2c65c9808ad37ea4c62a/href</a></iframe><pre>Dosya bulunamadı</pre><p>Diğer bir alternatif ise dosyanın varlığını kontrol eden eğer yoksa bu şekilde istediğimiz bir dosya yazdırıp onu okuttuğumuz bir fonksiyon yazmak olabilir. Böylelikle dosya yazdırıldıktan sonra okunur halde gelir.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e229686daec09c5f770fa9edb30387b/href">https://medium.com/media/3e229686daec09c5f770fa9edb30387b/href</a></iframe><pre>2014 <br>2015 <br>2016 <br>2017 <br>2018</pre><blockquote><strong><em>Dosya Okuma Yöntemleri</em></strong></blockquote><ul><li>readlines() -&gt; Satır satır okuma işlemi yapar ve değerleri bir liste halinde okur.</li></ul><p>Daha önceden for döngüsü içinde satır sonunda atlama yaparak dosya yazdırmayı görmüştük. Dosyayı okurken readlines() ile bu işlem kolayca gerçekleştirilir.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a87e4b22a2de89c8e6afa3297d6d48f/href">https://medium.com/media/7a87e4b22a2de89c8e6afa3297d6d48f/href</a></iframe><pre>2014  </pre><pre>2015  </pre><pre>2016  </pre><pre>2017  </pre><pre>2018  </pre><pre>2022  </pre><pre>2022</pre><p>Bir dosyayı <strong>‘r’</strong> ile okuma modunda açtığımız zaman bu dosyaya ekleme ya da yazma işlemi yapamayız, denediğimizde hata alırız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d036814f6a745501a232ca15ecd446e/href">https://medium.com/media/8d036814f6a745501a232ca15ecd446e/href</a></iframe><pre>--------------------------------------------------------------------UnsupportedOperation  <br>Traceback (most recent call last) Cell In [17], line 3       <br>     1 #okuma modunda açılan bir dosyaya ekleme yapmak istersek hata alırız       <br>     2 with open(&quot;yıllar.txt&quot;, &quot;r&quot;) as f: <br>----&gt;3     f.write(&quot;2022&quot;)  <br>UnsupportedOperation: not writable</pre><p>Fakat <strong>‘r+’ </strong>ile açarsak hem okuma hem de yazma işlemi yaptırabiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4da1e5123d1a006d46aa7d1b5782af23/href">https://medium.com/media/4da1e5123d1a006d46aa7d1b5782af23/href</a></iframe><pre>2014 <br>2015 <br>2016 <br>2017 <br>2018 <br>2022 <br>2022</pre><p>Var olan bir dosyayı tersten başa doğru okutmak için ise<strong> reversed()</strong> komutunu kullanırız.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/267fc45a9b627ea79198c9e65566297a/href">https://medium.com/media/267fc45a9b627ea79198c9e65566297a/href</a></iframe><pre>2022  </pre><pre>2022  </pre><pre>2022  </pre><pre>2018  </pre><pre>2017  </pre><pre>2016  </pre><pre>2015  </pre><pre>2014</pre><h3>Dosya Yazma</h3><ul><li>w</li><li>w+</li><li>a</li><li>a+</li></ul><p>Dosya yazma işleminde de yanlarına artı ekleyerek bazı işlemler yapmak mümkündür.</p><blockquote><strong>Dosya yazma yöntemleri</strong></blockquote><ul><li>write()</li><li>writelines()</li></ul><p>Doğrudan yazabildiğimiz gibi satır satır yazdırma seçeneğimiz de bulunmaktadır.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c589c5ab6bd72405f2bd5c6174249de/href">https://medium.com/media/9c589c5ab6bd72405f2bd5c6174249de/href</a></iframe><p>Aşağıdaki format ile alt alta ismimi yazdırdığım bir dosya yazdırabilirim.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f3a485656086920ad647182e99d3776/href">https://medium.com/media/2f3a485656086920ad647182e99d3776/href</a></iframe><pre>Başak<br>Dilara<br>Çevik</pre><blockquote><strong><em>Dosya Arama</em></strong></blockquote><p>Dosyalarda belirli aralıklar arasında okuma yapabiliriz.</p><pre>file.seek(imlec_konumu) -&gt; imlecin nereden başlanacağı bilgisi</pre><ul><li>file.seek(4)</li><li>file.seek(0, 5)</li><li>file.seek(4, 1)</li><li>file.seek(-8, 1)</li><li>file.seek(-9, 4)</li></ul><p>İmleci ikinci pozisyondan başlatarak yazının geri kalanını okutmak için:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0459cb4ac314bb85e63e2fcaed6b7c88/href">https://medium.com/media/0459cb4ac314bb85e63e2fcaed6b7c88/href</a></iframe><pre>14 <br>2015 <br>2016 <br>2017 <br>2018 <br>2022 <br>2022 <br>2022</pre><p>2022 satırlarından sadece birini okuması için:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1943c56ef1c4baaa18c393283467f99a/href">https://medium.com/media/1943c56ef1c4baaa18c393283467f99a/href</a></iframe><pre>2022</pre><blockquote><strong><em>Dosya yeniden adlandırma</em></strong></blockquote><ul><li>Önceden var olan bir dosyayı yeniden adlandırmak için <strong>rename()</strong> kullanabiliriz. Ancak olmayan bir dosyanın ismini değiştirmeye çalışırsak hata alırız.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd155921e3118d95b02608a4662b7ae6/href">https://medium.com/media/cd155921e3118d95b02608a4662b7ae6/href</a></iframe><pre>-------------------------------------------------------------------- FileNotFoundError             <br>Traceback (most recent call last) <br>Cell In [34], line 3       <br>1 import os <br>----&gt; 3 os.rename(&quot;yıllar.txt&quot;, &quot;yillar.txt&quot;)  <br>FileNotFoundError: [WinError 2] Sistem belirtilen dosyayı bulamıyor: &#39;yıllar.txt&#39; -&gt; &#39;yillar.txt&#39;</pre><ul><li><strong>remove()</strong> ile dosyaları silme işlemini gerçekleştirebiliriz. Ancak var olmayan bir dosyayı silmeye çalıştığımızde yine hata alırız.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac5e2dabea5dea915807ec5f7b8b4405/href">https://medium.com/media/ac5e2dabea5dea915807ec5f7b8b4405/href</a></iframe><pre>-------------------------------------------------------------------- FileNotFoundError             <br>Traceback (most recent call last) <br>Cell In [38], line 3       <br>1 import os <br>----&gt; 3 os.remove(&quot;isim-soyisim.txt&quot;<br>FileNotFoundError: [WinError 2] Sistem belirtilen dosyayı bulamıyor: &#39;isim-soyisim.txt&#39;</pre><p>Başlıca dosyalama işlemlerine değindik. Serinin sonuna adım adım yaklaşıyoruz. Python konusunda epey yol aldık, okuyan, alkışlayan herkese bolca teşekkür ederim. Umarım faydalı bir yazı serisi olmuştur. Bir sonraki Python yazısında görüşmek üzere.😊🦊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*rqVCS16KG5aDIR0BoFfKHw.gif" /><figcaption>Image via <a href="https://giphy.com/stickers/Netzfrequenz-file-nfq-netzfrequenz-p4XDLC2drSHGm2Gudt">Giphy</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f8c097e64c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#2½ SQL: Veri Tipleri ve Tablo]]></title>
            <link>https://basakdilaraavci.medium.com/2%C2%BD-sql-veri-tipleri-ve-tablo-1e4b0c2a351c?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e4b0c2a351c</guid>
            <category><![CDATA[table]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-type]]></category>
            <category><![CDATA[sql-table-variable]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Fri, 04 Nov 2022 15:02:38 GMT</pubDate>
            <atom:updated>2022-11-04T15:02:38.646Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*NgRPa3QrSt7KwpZypqJz9Q.gif" /></figure><h3>Veri Tipleri</h3><p>SQL kullanırken tablo oluşturduğumuzda sütunlara ek olarak bu sütunlarda hangi tip verinin kullanılmasının serbest olacağını da tanımlamız gerekmektedir. Veri tiplerinde verilen bir sütun için istikrara ihtiyacımız vardır. Örneğin yaş ile alakalı bir sütuna yazılan ‘genç’ cevabının karesini almak istediğimizde problem yaşarız.</p><p>MySQL’de çok fazla veri tipi bulunmaktadır. Ancak bazıları diğerlerinden daha sık kullanılmaktadır. Bunlar başlıca:</p><p>1-) Sayı Veri Türleri (Numeric)</p><ul><li>INT</li><li>SMALLINT</li><li>TINYINT</li><li>MEDIUMINT</li><li>BIGINT</li><li>DECIMAL</li><li>NUMERIC</li><li>FLOAT</li><li>DOUBLE</li><li>BIT</li></ul><p>2-) Metin Tabanlı Veri Türleri (String)</p><ul><li>CHAR</li><li>VARCHAR</li><li>BINARY</li><li>VARBINARY</li><li>BLOB</li><li>TINYBLOB</li><li>MEDIUMBLOB</li><li>LONGBLOB</li><li>TEXT</li><li>TINYTEXT</li><li>MEDIUMTEXT</li><li>ENUM</li></ul><p>3-) Tarih Veri Türleri (Date)</p><ul><li>DATE</li><li>DATETIME</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F15679347&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Femoji-relieved-phew-wipe-sweat-gif-15679347&amp;image=https%3A%2F%2Fmedia.tenor.com%2FNLsIYJMtEdsAAAAC%2Femoji-relieved.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/e8c9e28a23615f206ff1e7d54fc72c77/href">https://medium.com/media/e8c9e28a23615f206ff1e7d54fc72c77/href</a></iframe><blockquote>Çok fazla, değil mi? Hepsinin ayrı ayrı kullanılmasının bir sebebi var. Ancak çoğu zaman hepsini ezbere bilmeye gerek yok diye düşünüyorum ben. Tabii siz veri tiplerini çok seviyorsanız tabii ki araştırıp hepsinin detayını öğrenebilirsiniz. Buyurunuz bu da <a href="https://www.supforce.com/web/mysql-veri-tipleri-anlamlari/">açıklayıcı bir link…</a> Veya doğrudan<a href="https://dev.mysql.com/doc/refman/8.0/en/data-types.html"> kendi dokümantasyonuna</a> da bakabilirsiniz.</blockquote><p>INT ve VARCHAR benim en çok kullandığım kategoriler olacak. Dolayısıyla onlardan biraz bahsetmeliyim.</p><p>INT yalnızca tam sayı değeri tutar. Maksimum karakter genişliği değeri tutar. Maksimum değer (s<em>igned) 2147483647&#39;dir.</em> Negatif sayıları tutacak şekilde ayarladığımız zaman ise<em> </em>0 ile 4294967295 arasındaki sayılar kadar depolarlar demek mümkündür.</p><p>VARCHAR bir değişken uzunluğundaki <em>string </em>tipinde bir veri tipidir. Bu değişken en fazla 255 olabilir. ‘Tırnakarasıkaraktersayısı?’ 26 tane karakter içermektedir. Tırnaklar ise bunun bir <em>string </em>olduğunu belirtmektedir.</p><p>Bunlara ek olarak, tablo oluştururken veri tipini belirttiğimiz sırada izin verilecek maksimum değeri belirtmemiz de mümkündür. Örneğin <em>varchar(100)</em> sütununa maksimum 100 değerden oluşam bir<em> string</em> yazılabileceğini söylemiş oluyoruz.</p><h3><strong>Tablolar</strong></h3><pre>CREATE DATABASE medium_yazilarim;<br>USE medium_yazilarim;<br>SELECT DATABASE()</pre><p>Yeni bir veri tabanı oluşturup işlem yapacağımız veri tabanı olarak onu seçerek hızlı bir giriş yapalım. Daha sonrasında ise bu veri tabanında kullanıcı adı, gönderisi ve aldığı beğeni sayısını içeren bir tablo oluşturulam ve bunu yaparken veri tipine, aynı zamanda karakter sınırlamasına dikkat edelim.</p><pre>CREATE TABLE insta(<br>    -&gt; kullanici_adi VARCHAR(15),<br>    -&gt; gönderi VARCHAR(100),<br>    -&gt; begeni INT<br>    -&gt; );</pre><p>İlk sütunun maksimum 15 karakterle kullanıcı adı olacağını, ikinci sütunun maksimum 100 karakter ile gönderinin içeriği olaracağını ve üçüncü sütunun ise beğeni sayısı olacağını belirttim.</p><pre>SHOW TABLES;<br>SHOW COLUMNS FROM insta;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*MhiZnWas8VxxnvNa2pe9pw.png" /></figure><p>Tablomuzu oluşturmuş olduk. Ancak maalesef <em>insta</em> adında bir tablo oluşturmuşuz. Oysa ki amacımız başka isimde bir tablo oluşturmaktı.</p><p>Bu durumda şu anki tabloyu silip yeni bir tablo oluşturabiliriz.</p><pre>DROP TABLE insta;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*ucvVdQOH21Nvzb_vR_TOww.png" /></figure><p>Böylelikle yeni tabloyu oluşturmuş oldum.</p><p>Biraz kısa bir yazı oldu. Bu yüzden bunu 2. SQL yazımın devamı niteliğinde düşünebilirsiniz. Bir sonraki SQL yazısında görüşmek üzere! 🦊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*_rn3xywoiKWMFThtzkpSuA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e4b0c2a351c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#2 SQL: Veri Tabanı ve Tablo Oluşturma]]></title>
            <link>https://basakdilaraavci.medium.com/2-sql-veri-taban%C4%B1-ve-tablo-olu%C5%9Fturma-197c4a7ccea?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/197c4a7ccea</guid>
            <category><![CDATA[veritabanı]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[ilişkisel-veritabanı]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Mon, 31 Oct 2022 15:05:11 GMT</pubDate>
            <atom:updated>2022-11-01T05:16:47.457Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*LnOSvWkXLLZPtkjWpau4MA.gif" /><figcaption>Image via<a href="https://giphy.com/gifs/animation-animated-gif-xTiTnxpQ3ghPiB2Hp6"> Giphy</a></figcaption></figure><h3>1-) Veri Tabanı Oluşturma</h3><blockquote><strong>Veri tabanlarını kontrol etme</strong></blockquote><p>Veri tabanlarını tutabilmek için sunucuya (<em>server</em>) ihtiyacımız vardır. Bu sunucunun içerisinde birbirinden bağımsız veri tabanları ve tablolar bulundurulabilir. Serinin ilk yazısında MySQL indirmiştik. Bununla beraber bazı örnek veri tabanları yüklenmiş olmalı. Fakat şimdilik onlara ihtiyacımız yok.</p><ul><li>Not: Ben Windows üzerinden anlatacağım ancak MySQL’in, özellikle Workbench olmak üzere kullanım biçimleri Mac ile oldukça benzer.</li></ul><p>Komut istemini açtıktan sonra,</p><pre>cd &quot;C:\Program Files\MySQL\MySQL Server 8.0\bin&quot;</pre><p>komutunu çalıştırarak MySQL’e giriş yapabileceğimiz lokasyona gidebiliriz.</p><pre>mysql -u root -p</pre><p>komutu ise bizden daha önceden oluşturduğumuz şifreyi isteyecektir. Şifre ile giriş yaptıktan sonra artık hazırız.</p><pre>show databases;</pre><p>yazdığımız zaman sunucuda bulundurduğumuz veri tabanlarını görebiliriz. Noktalı virgülü yazmadığımızda veya uygun biçimde yazmadığımızda hata alırız. Şu an bulunanların bir önemi yok ancak veri tabanlarımızın olduğunu ve her şeyin normal şekilde çalıştığını görebiliyoruz bu şekilde.</p><p>Eğer Workbench’i kullanmak istersek, Workbench’i açtıktan sonra sunucuya bağlanmamız ve şifre ile giriş yapmamız gerekir. Hazırda gelen veri tabanlarına bakmak için aşağıdaki kodu çalıştırıp yukarıdaki ikonlardan yıldırım ikonuna basabiliriz. ⚡</p><pre>show databases;</pre><p>Aynı veri tabanlarını görebiliriz.</p><blockquote><strong>Yeni veri tabanı oluşturma</strong></blockquote><p>Veri tabanlarını incelemeyi gördük. Boş bir veri tabanı oluşturmak için kullanmamız gereken kod aşağıdaki gibidir. Büyüktür ve küçüktür işaretleri ile oluşturulan ayraç, bu alanın arasındaki kısmı kendi isteğinize ve bilgisayarınıza göre uyarlamanız gerektiği anlamına gelmektedir.</p><pre>CREATE DATABASE &lt;veritabanı_adı&gt;;</pre><p>Örneğin;</p><pre>CREATE DATABASE hayvanat_bahcesi;</pre><p>veya</p><pre>CREATE DATABASE HayvanatBahcesi;</pre><p>biçiminde isimlendirmemiz hatasız işlemler yapabilmek için ve herhangi bir problemle karşılaşmamak için ideal olacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*GE3TWUQXqnaL8Y4zfHfttg.png" /></figure><p>Şimdi veri tabanlarımızı yeniden incelersek oluşturduğumuz veri tabanının eklendiğini görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*KzUIt_Gc4e8LZn-OjE3Mtg.png" /></figure><blockquote><strong>Veri tabanı silme</strong></blockquote><p>Bir veri tabanını içindeki tüm verilerle beraber silmek mümkündür. Ancak bu işlemi yaparken son derece dikkatli olunmalıdır. Aksi halde ok önemli verileri kaybedebilirsiniz.</p><pre>DROP DATABASE &lt;veritabanı_adı&gt;;</pre><p>Az önce oluşturduğumuz veri tabanını silme işlemini gerçekleştirelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*RV6JE1-3w_E2tWDYPpYjxA.png" /></figure><blockquote><strong>Veri tabanını kullanma</strong></blockquote><p>SQL ile birden fazla veri tabanı ile uğraşıyor olacağız. Bunu yaparken kullanacağımız veri tabanını konsoloda veya Workbench’te belirtmemiz gerekmektedir.</p><p>Aşağıdaki kodu kullanarak hangi veri tabanıyla işlem yapabileceğimizi belirtebiliriz.</p><pre>USE &lt;veritabanı_adı&gt;</pre><p>Yeni bilgi ekleme, bilgiyi bulma, veri tabanı içerisinde bilgi veya tablo oluşturma gibi işlemleri yapacağımızda bu işlemin hangi veri tabanında gerçekleşeceğini mutlaka belirtmemiz gerekmektedir.</p><pre>SELECT database();</pre><p>komutu ile şu an hangi veri tabanında olduğumuzu kontol edebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*7yI3lFwHyzU885Z6JbiB8Q.png" /></figure><h3>2-) Tablo Oluşturma</h3><p>SQL ile sıklıklı yapılan işlemler doğrudan veri tabanı üzerindeki değişikliklerden ziyade tablolarda yapılan değişikliklerden oluşmaktadır. İlişkisel veritabanları kapsamında veri tabanı bir veya daha fazla tablodan oluşur. Tablolar veriyi tutmamızı sağlayan araçlardır. Verimizin tipi ve biçimi şeklinde o veriyi tutacak şekildedirler.</p><p>Veri tabanlarının birçok tablodan oluşması derken bahsedilen durumu aşağıdaki görüntüde gözlemleyebilirsiniz.</p><figure><a href="https://soft-builder.com/how-to-list-tables-in-mysql-database/"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kRRxYC1BxXDKjM6qDTmlAw.png" /></a><figcaption><a href="https://soft-builder.com/how-to-list-tables-in-mysql-database/">Tabloların örneği</a></figcaption></figure><p>Bu tabloların çoğunun birbiriyle bir bağlantısı, yani ilişkisi vardır. İlişkisel veritabanı adı da bunu ifade etmektedir.</p><blockquote><strong>Tablo oluşturma</strong></blockquote><p>Veri tiplerinden henüz bahsetmedik ancak veriler genelde türlerine göre sınıflandırır diyebiliriz. Bir sonraki yazımda bu veri tiplerinden daha detaylı bir şekilde bahsedeceğim.</p><p>Bir tablo oluşturmak istediğimizde aşağıdaki biçimde yapabiliriz. Tabii bunların hepsini aynı satırda da yazabilirdik çünkü SQL için önemli olan kullandığımız noktalama işaretleridir. Görsel olarak okunaklı olması için bu biçimde yazmaktayım.</p><pre>CREATE TABLE &lt;tablo_ismi&gt;<br>(   <br>   sutun_ismi veri_tipi<br>   sutun_ismi veri_tipi<br>);</pre><p>Diyelim ki muhabbet kuşlarımın isimlerini ve yaşlarını tutan bir tablo oluşturmak istiyorum.</p><pre>CREATE TABLE kuslarım<br>(<br>   isim VARCHAR(100),<br>   yasi INT<br>);</pre><blockquote>Tabloya erişme</blockquote><pre>SHOW TABLES;</pre><p>komutu ile veri tabanında bulunan tablolarımızı görebiliriz.</p><pre>SHOW COLUMNS FROM kuslarım;</pre><p>komutu ile tablomuz hakkında detaylı bilgilere ulaşabiliriz.</p><p>Sütunların isimlerine ve bilgilerine ulaşma işlemini,</p><pre>DESC kuslarım;</pre><p>kullanarak daha kısa bir komut ile de yapabilirdim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*Xg38-49EnZz91srS96GKCQ.png" /></figure><p>Bunlara ek olarak oluşturduğumuz tabloyu kontrol etmenin pek çok yolu daha vardır. İlerleyen yazılarımda ihtiyaç olması durumunda onlardan da detaylıca bahsedeceğim.</p><p>Bu yazıda veri tabanı oluşturma, silme, tablo oluşturma gibi konulara kısaca değindim. Bir sonraki yazımda veri tiplerinden ve tablolardan daha ayrıntılı bir şekilde bahsedeceğim. O zamana kadar kendinize iyi bakın! 👾</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*kgcIwdHFHqevFpSwZ3pTjw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=197c4a7ccea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#1 SQL: Giriş]]></title>
            <link>https://basakdilaraavci.medium.com/1-sql-giri%C5%9F-f6cf95a7a1a5?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6cf95a7a1a5</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[structured-query-language]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[query]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Fri, 28 Oct 2022 15:32:04 GMT</pubDate>
            <atom:updated>2022-10-30T10:45:39.804Z</atom:updated>
            <content:encoded><![CDATA[<ul><li><a href="#0266"><strong>Veri tabanı nedir?</strong></a></li><li><a href="#f04b"><strong>SQL ile MySQL farkı nedir?</strong></a></li><li><a href="#560f"><strong>Nasıl yüklenir?</strong></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*QQQPo-QluuDjLnutb-WIPw.gif" /><figcaption>Image via<a href="https://giphy.com/gifs/Pluralsight-computer-technology-coding-L1R1tvI9svkIWwpVYr"> Giphy</a></figcaption></figure><ul><li><strong>Veri tabanı nedir?</strong></li></ul><p>En basit tanımıyla<strong> veri tabanı,</strong> birtakım bilgilerin toplanıp tutulduğu alandır. Veri tabanları ulaşılabilen ve değişitirebilen bir veri bütünüdür, demek mümkündür. V<strong>eri tabanı yönetim sistemi </strong>de bu alanda ismini sıklıkla duyacağımız veri tabanları ile doğrudan alakalı bir sistemdir. Veri tabanı yönetim sistemi, bir yazılım ile o yazılımın verilerinin depolandığı alan arasındaki aktarımı mümkü kılan bir sistemdir. Örneğin bir uygulamada veri tabanını ilgilendiren bir işlem yapmak istediğimizde biz veri tabanı yönetim sistemine başvururuz, o da veri tabanı ile iletişim kurar. Yine de günümüzde genellikle veri tabanından bahsedilirken aslında veri tabanı yönetim sisteminden bahsedilmektedir. MySQL, SQLite aslında birer veri tabanı yönetim sistemi olsa da isimlerinin veri tabanı olarak geçtiğini duymak mümkündür. Ben SQL yazı serim boyunca veri tabanını ‘ulaşılabilir durumda bulunan, yapılandırılmış ve makinelere uyarlanmış veri topluluğu’ anlamında kullanacağım.</p><ul><li><strong>SQL ile MySQL farkı nedir?</strong></li></ul><p>SQL <em>(Structured Query Language)</em> veri tabanları ile konuştuğumuz dildir. Veri tabanına yaptığımız istekler sorgu (query) olarak geçer. Zaten sorgu kısaca, bilgi için yapılan istektir. Bir sorgu yaptığımızda SQL bizim yerimize veri tabanı ile iletişime geçer.</p><pre>-&gt; 65 yaş ve üstü kullanıcıları bul.</pre><pre>SELECT * FROM Users WHERE Age &gt;= 18;</pre><p>Bu seride SQL yazarak MySQL kullanmayı anlatacağım. Bu ifaden de anlaşıldığı gibi SQL kullandığımız dil olurken MySQL ise kullandığımız arayüz olacak. MySQL’in yanı sıra en yaygın<strong> ilişkisel veri tabanları</strong> arasında Oracle, SQLite, PostgreSQL ve daha bir çok sistem yer almaktadır. Bu sistemlerin hepsi ortak olarak SQL kullandıkları için hangisini kullanıyorsak kullanalım, 65 yaş ve üstü kullanıcıları bulmak için aynı sorguyu yaparız. Bu sistemler arasında sözdizimi <em>(syntax)</em> bakımından küçük farklar bulunmaktadır. Dolayısıyla SQL öğrendikten sonra bu ilişkisel veri tabanları arasında geçiş yapmak çok zor değildir. Kodlar aynı olsa da bu sistemleri birbirinden farklı yapan sistemlerin özellikleridir. Ne kadar güvenli, ne kadar hızlı, ne kadar kullanıcı dostu olduğu gibi ayrımlar birini diğerine göre daha tercih edilebilir kılabilir.</p><p>İlişkisel veri tabanı yönetim sistemleri ile komut satırı aracılığıyla terminalden veya MySQL Workbench kullanarak etkileşime girmek mümkündür. Zaman zaman her iki arayüze de ihtiyaç duyulabilmektedir.</p><ul><li><strong>Nasıl yüklenir?</strong></li></ul><blockquote>Windows</blockquote><p><a href="https://dev.mysql.com/downloads/installer/">1-) Bu linkten </a><em>web-community</em> versiyonunu seçiniz.</p><p>2-) Custom yükleme seçeneğini seçiniz.</p><p>3-) MySQL for Visual Studio’yu özel olarak ihiyacınız yoksa sola sürükleyerek indirilecekler listesinden çıkartabilirsiniz.</p><p>4-) Gereklilikleri yükleyiniz.</p><p>5-) Authentication Method sekmesine kadar hiçbir şeyi değiştirmeden ilerleyiniz. Bu alanda ileri dedikten sonra şifrenizi belirleyiniz. <em>Root user, </em>MySQL için en yüksek seviyeli kullanıcıdır. Mutlaka güçlü ve hatırlayabileceğiniz bir şifre kullanın.</p><p>6-) Yüklemeyi tamamladıktan sonra <strong>root</strong> kullanıcı adı ve oluşturduğunuz şifre ile giriş yapınız.</p><p>7-) Artık arama çubuğundan MySQL Workbench’e ve MySQL Command Line Client’a erişebiliriz. Comman Line Client’ı açınız ve şifreniz ile giriş yapınız.</p><p>8-) Client’tan çıkış yapmak için çıkış tuşuna alternatif olarak <em>quit; </em>yazarak da çıkışyapabilirsiniz.</p><p>SQL serisinde daha çok Workbench kullanacağım, dolayısıyla gelecek yazılarımda Workbench ile ilgili daha ayrıntılı bilgilendirmeler yapacağım.</p><blockquote>Mac</blockquote><ul><li>Mac kullanıcısı olmadığım için sadece birkaç temel linki paylaşacağım ve önemli noktalara değineceğim.</li></ul><p>1-) <a href="https://dev.mysql.com/downloads/mysql/">Bu linke</a> tıklayıp macOS seçeneğini işaretledikten sonra indirmeye başlayınız. Mimarisinin kendi işletim sisteminizle uygunluğunu kontrol etmeyi unutmayınız.</p><p>2-) Güvenlik uyarısı alırsanız güvenlik vegizlilik ayarlarından <em>‘Open Anyway’ </em>seçeneğini tercih edebilirsiniz.</p><p>3-) <em>Configuration </em>sekmesine kadar ilerleyiniz. Bu alanda şifrenizi belirleyiniz. <em>Root user, </em>MySQL için en yüksek seviyeli kullanıcıdır. Mutlaka güçlü ve hatırlayabileceğiniz bir şifre kullanın.</p><p>4-) Terminalde ismininizi ve şifrenizi kullanarak giriş yapınız.</p><p>5-) <a href="https://dev.mysql.com/downloads/workbench/">Bu linkten</a> MySQL Workbench’i indiriniz. Bağlantıyı kurunuz ve şifreniz ile giriş yapınız.</p><p>6-) Bir nedenden ötürü Workbench’i indiremezseniz <a href="https://dbgate.org/">bu linkten </a>DbGate veya diğer alternatifleri indirerek kullanabilirsiniz.</p><p>SQL yazı serisi için başlangıç yazımın sonuna geldim. Umarım kısa ve etkili bir giriş olmuştur. Bir sonraki yazımda veri tabanları ve tablo oluşturmayı anlatacağım. O zamana kadar kendinize iyi bakın! 👾</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*LOGyl3h2Uj1i70wzi4pkrQ.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6cf95a7a1a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#7 Python: Veri Yapıları | Dictionary]]></title>
            <link>https://basakdilaraavci.medium.com/7-python-veri-yap%C4%B1lar%C4%B1-dictionary-bb41b81ce61b?source=rss-a0d31ab9b0cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb41b81ce61b</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[what-is-python-dictionary]]></category>
            <category><![CDATA[dictionary]]></category>
            <category><![CDATA[python-dictionaries]]></category>
            <category><![CDATA[python-dict]]></category>
            <dc:creator><![CDATA[Başak Dilara Avcı]]></dc:creator>
            <pubDate>Mon, 24 Oct 2022 09:41:36 GMT</pubDate>
            <atom:updated>2022-10-24T09:41:36.880Z</atom:updated>
            <content:encoded><![CDATA[<p>Merhaba, SistersLab’in Toplum Gönüllüleri Vakfı (<a href="https://www.tog.org.tr/">TOG</a>) tarafından desteklenen Women in Tech Academy proje katılımcılarından biriyim. Proje, 20–28 yaş aralığında beyanı kadın olan bireyleri 3 ay boyunca yazılım eğitimi ve destekleyici eğitimlerle güçlendirerek sektörde iş gücüne katılımını artırmayı hedefliyor. Projeyle ilgili detaylı bilgiye bu bağlantıdan ulaşabilirsiniz: <a href="https://sisterslab.co/women-in-tech-academy/">Women in Tech Academy</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*qZzXR7IDn_dGjKBLLKKI9w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*WX8vi2JxI5jR5IfN-iF-Dg.png" /><figcaption>Image via <a href="https://www.clipartmax.com/middle/m2H7N4d3Z5H7N4K9_the-running-dictionary-by-xellenor-walking-dictionary-cartoon/">Clipartmax</a></figcaption></figure><p>Merhabalar. Akademi boyunca aldığımız Python eğitimlerini derleyip sizlerle paylaşacağım. Kendi bilgilerimin kalıcılığını yükseltmenin yanı sıra bilgilerin paylaştıkça çoğaldığına inanan biri olarak hem bilgi akışına hem de Türkçe kaynaklara desteğimi sağlamayı hedefliyorum.</p><ul><li><a href="https://basakdilaracevik.medium.com/pythona-giri%C5%9F-4518f3322f55"><strong>#1 Python’a Giriş</strong></a></li><li><a href="https://medium.com/@basakdilaracevik/python-fonksiyonlar-40b311f69cb4"><strong>#2 Python: Fonksiyonlar</strong></a></li><li><a href="https://medium.com/@basakdilaracevik/python-kontrol-yap%C4%B1lar%C4%B1-ve-d%C3%B6ng%C3%BCler-aa6567ac2006"><strong>#3 Python: Kontrol Yapıları ve Döngüler</strong></a></li><li><a href="https://medium.com/@basakdilaracevik/python-veri-yap%C4%B1lar%C4%B1-list-9851d37e40c6"><strong>#4 Python: Veri Yapıları | List</strong></a></li><li><a href="https://medium.com/@basakdilaracevik/python-veri-yap%C4%B1lar%C4%B1-tuple-7baeb75ee34f"><strong>#5 Python: Veri Yapıları | Tuple</strong></a></li><li><a href="https://medium.com/@basakdilaracevik"><strong>#6 Python: Veri Yapıları | Set</strong></a></li></ul><p><strong>Dictionary</strong></p><ul><li>Sıralı değildir. <em>(unordered) </em>Dolayısıyla indeks <em>(index)</em> ile erişilemezler.</li><li>Anahtar-değer <em>(key-value)</em> mantığında tutulur. Değerlere anahtar <em>(key)</em> üzerinden erişiriz.</li><li>Dictionary değiştirilebilir. <em>(mutable)</em></li><li>{} içerisinde tanımlanır. Anahtar-değer çiftini virgüllerle ayrılır.</li><li>Farklı tipte veriler içerebilir.</li><li>Anahtar değerleri benzersiz olacak şekilde taşıdıkları değerler aynı olabilir. (<em>duplicate)</em></li></ul><p><strong>Dictionary oluşturma yöntemleri</strong></p><ul><li>{} ile doğrudan boş bir sözlük oluşturabiliriz</li></ul><p>veya</p><ul><li><strong>dict(</strong>) ile oluşturabiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59dae6aff6f160cfb95dabfc677b4b81/href">https://medium.com/media/59dae6aff6f160cfb95dabfc677b4b81/href</a></iframe><pre><strong>Output:<br></strong>{&#39;isim&#39;: &#39;Başak&#39;,<br> &#39;okul&#39;: &#39;Hacettepe Üniversitesi&#39;,<br> &#39;bölüm&#39;: &#39;İktisat&#39;,<br> &#39;yaş&#39;: 27,<br> &#39;mezun&#39;: True,<br> &#39;gpa&#39;: 3.03}</pre><ul><li>Daha önceden sözlüğün içermediği bir anahtar-değer çiftini ekleyebiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ade9927ddc88501c06846d03223279b/href">https://medium.com/media/0ade9927ddc88501c06846d03223279b/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;isim&#39;: &#39;Başak&#39;,<br> &#39;okul&#39;: &#39;Hacettepe Üniversitesi&#39;,<br> &#39;bölüm&#39;: &#39;İktisat&#39;,<br> &#39;dersler&#39;: [&#39;Veri Yapıları&#39;, &#39;Veri Madenciliği&#39;, &#39;İstatistik&#39;],<br> &#39;yaş&#39;: 27,<br> &#39;mezun&#39;: True,<br> &#39;gpa&#39;: 3.03}</pre><p><strong>Dict() </strong>ile oluşturmak istediğimizde aşağıdaki biçimi kullanabiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d4d965339c3b0c4dcbb3d9423494802/href">https://medium.com/media/0d4d965339c3b0c4dcbb3d9423494802/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;isim&#39;: &#39;Başak&#39;, &#39;okul&#39;: &#39;Hacettepe Üniversitesi&#39;}</pre><p>Sözlüğümüzün tipine <strong>type() </strong>ile baktığımızda tipinin <em>dict </em>olduğunu görebiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e7d7b7eb84d46ffdf38c715947050d6/href">https://medium.com/media/1e7d7b7eb84d46ffdf38c715947050d6/href</a></iframe><pre><strong>Output:</strong></pre><pre>dict</pre><p><strong>Sözlük Elemanlarına Erişim</strong></p><ul><li>[] içinde anahtar (<em>key</em>) değerini vererek</li></ul><p>veya</p><ul><li><strong>get() </strong>içerisinde anahtar değerini vererek sözlük elemanlarına erişebiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0379d89a26d81e4891470f27a57171b6/href">https://medium.com/media/0379d89a26d81e4891470f27a57171b6/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02692ef8bfa892a8665188d97532e071/href">https://medium.com/media/02692ef8bfa892a8665188d97532e071/href</a></iframe><pre><strong>Output:</strong></pre><pre>&#39;kırmızı&#39;</pre><ul><li><em>‘black’</em> anahtarı bize <em>‘siyah’</em> değerini verir.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bce74b4aa3e4c5cd6e19e60c58baab52/href">https://medium.com/media/bce74b4aa3e4c5cd6e19e60c58baab52/href</a></iframe><pre><strong>Output:</strong></pre><pre>&#39;siyah&#39;</pre><ul><li>Sözlükte yer alan tüm anahtarlara <strong>keys() </strong>ile erişebiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9640ae39db9670b28ed557e66969d107/href">https://medium.com/media/9640ae39db9670b28ed557e66969d107/href</a></iframe><pre><strong>Output:</strong></pre><pre>dict_keys([&#39;black&#39;, &#39;red&#39;, &#39;green&#39;, &#39;blue&#39;, &#39;white&#39;])</pre><ul><li>Sözlükte yer alan tüm değerlere <strong>values() </strong>ile erişebiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/49eb34ffc4c8545168f95e6fdc5818c7/href">https://medium.com/media/49eb34ffc4c8545168f95e6fdc5818c7/href</a></iframe><pre><strong>Output:</strong></pre><pre>dict_values([&#39;siyah&#39;, &#39;kırmızı&#39;, &#39;yeşil&#39;, &#39;mavi&#39;, &#39;beyaz&#39;])</pre><ul><li>Anahtar-değer (<strong>key-value</strong>) ikilisine erişmek içinse <strong>items() </strong>kullanabiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac4206b30ae209c8f07cf4afb53506d1/href">https://medium.com/media/ac4206b30ae209c8f07cf4afb53506d1/href</a></iframe><pre><strong>Output:</strong></pre><pre>dict_items([(&#39;black&#39;, &#39;siyah&#39;), (&#39;red&#39;, &#39;kırmızı&#39;), (&#39;green&#39;, &#39;yeşil&#39;), (&#39;blue&#39;, &#39;mavi&#39;), (&#39;white&#39;, &#39;beyaz&#39;)])</pre><ul><li>Döngü kullanarak her birinin anahtarını, değerini ve anahtar-değer çiftini alt alta yazdırabiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9dd86e3248b1722132012a11226a210c/href">https://medium.com/media/9dd86e3248b1722132012a11226a210c/href</a></iframe><pre><strong>Output:</strong></pre><pre>black<br>red<br>green<br>blue<br>white</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1db1b7ad147cc24e4a3ec84f84a771c7/href">https://medium.com/media/1db1b7ad147cc24e4a3ec84f84a771c7/href</a></iframe><pre><strong>Output:</strong></pre><pre>siyah<br>kırmızı<br>yeşil<br>mavi<br>beyaz</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7740ecf836103aef33166c6bda97411/href">https://medium.com/media/d7740ecf836103aef33166c6bda97411/href</a></iframe><pre><strong>Output:</strong></pre><pre>(&#39;black&#39;, &#39;siyah&#39;)<br>(&#39;red&#39;, &#39;kırmızı&#39;)<br>(&#39;green&#39;, &#39;yeşil&#39;)<br>(&#39;blue&#39;, &#39;mavi&#39;)<br>(&#39;white&#39;, &#39;beyaz&#39;)</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5cbe196d2c6b819763dfbf4b79178767/href">https://medium.com/media/5cbe196d2c6b819763dfbf4b79178767/href</a></iframe><pre><strong>Output:</strong></pre><pre>key: black value: siyah<br>key: red value: kırmızı<br>key: green value: yeşil<br>key: blue value: mavi<br>key: white value: beyaz</pre><ul><li>Yine<strong> len() </strong>ile sözlüğün uzunluğuna ulaşmak mümkündür.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08badf954d1428481bcd6157a51a2b6b/href">https://medium.com/media/08badf954d1428481bcd6157a51a2b6b/href</a></iframe><pre><strong>Output:</strong></pre><pre>Sözlüğün uzunluğu:  5</pre><p><strong>Sözlüğe Eleman Ekleme</strong></p><p>Eğer aynı değer daha önce bir anahtara tanımlandıysa değergüncellenir, tanımlanmadıysa ikili sıfırdan eklenir.</p><ul><li>Anahtar-değer atama işlemi ile</li></ul><p>veya</p><ul><li>update() metodu ile sözlüğe eleman ekleyebiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e348d07422d15e8352dad6404ac52424/href">https://medium.com/media/e348d07422d15e8352dad6404ac52424/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;isim&#39;: &#39;Başak&#39;,<br> &#39;okul&#39;: &#39;Hacettepe Üniversitesi&#39;,<br> &#39;bölüm&#39;: &#39;İktisat&#39;,<br> &#39;dersler&#39;: [&#39;Veri Yapıları&#39;, &#39;Veri Madenciliği&#39;, &#39;İstatistik&#39;],<br> &#39;yaş&#39;: 27,<br> &#39;mezun&#39;: True,<br> &#39;gpa&#39;: 3.03}</pre><blockquote>Atama yolu ile:</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/24227e20fcf70812a8a1aaadb4d16234/href">https://medium.com/media/24227e20fcf70812a8a1aaadb4d16234/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;isim&#39;: &#39;Başak&#39;,<br> &#39;okul&#39;: &#39;Hacettepe Üniversitesi&#39;,<br> &#39;bölüm&#39;: &#39;İktisat&#39;,<br> &#39;dersler&#39;: &#39;Ekonometri&#39;,<br> &#39;yaş&#39;: 27,<br> &#39;mezun&#39;: True,<br> &#39;gpa&#39;: 3.03}</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/623d242dfcdb9f56a500935fc78a1f9d/href">https://medium.com/media/623d242dfcdb9f56a500935fc78a1f9d/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;isim&#39;: &#39;Başak&#39;,<br> &#39;okul&#39;: &#39;Hacettepe Üniversitesi&#39;,<br> &#39;bölüm&#39;: &#39;İktisat&#39;,<br> &#39;dersler&#39;: &#39;Ekonometri&#39;,<br> &#39;yaş&#39;: 27,<br> &#39;mezun&#39;: True,<br> &#39;gpa&#39;: 3.03,<br> &#39;favorirenk&#39;: &#39;kırmızı&#39;}</pre><blockquote><strong>update() </strong>metodu ile</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fdaac4010cdda7eac7a5c8816c06c887/href">https://medium.com/media/fdaac4010cdda7eac7a5c8816c06c887/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;isim&#39;: &#39;Başak&#39;,<br> &#39;okul&#39;: &#39;Hacettepe Üniversitesi&#39;,<br> &#39;bölüm&#39;: &#39;İktisat&#39;,<br> &#39;dersler&#39;: &#39;Ekonometri&#39;,<br> &#39;yaş&#39;: 28,<br> &#39;mezun&#39;: True,<br> &#39;gpa&#39;: 3.03,<br> &#39;favorirenk&#39;: &#39;kırmızı&#39;,<br> &#39;Şehir&#39;: &#39;Ankara&#39;}</pre><p><strong>Sözlükte Eleman Silme</strong></p><p>Sözlükten eleman silme işlemini 5 farklı şekilde yapabiliriz.</p><figure><a href="https://github.com/badicev/PythonEgitim/blob/main/png-setoperators1.jpg?raw=true"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WA9Bo6dy4y8iEjskwiUkJg.jpeg" /></a></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89ff2660c92f20ca341aead0b3e4a261/href">https://medium.com/media/89ff2660c92f20ca341aead0b3e4a261/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;öğrenci_adı&#39;: &#39;Dilara&#39;,<br> &#39;numara&#39;: 21311405,<br> &#39;mezuniyet_yılı&#39;: 2019,<br> &#39;bölüm&#39;: &#39;İktisat&#39;}</pre><ul><li><strong>del()</strong> ile bir anahtar-değer ikilisini tamamen sözlükten kaldırabiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9480571f89449c1f3dc57f4bf71802eb/href">https://medium.com/media/9480571f89449c1f3dc57f4bf71802eb/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;öğrenci_adı&#39;: &#39;Dilara&#39;, &#39;numara&#39;: 21311405, &#39;bölüm&#39;: &#39;İktisat&#39;}</pre><ul><li><strong>clear()</strong> ile sözlüğü boş bir sözlük haline getirebiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef462e50212ba97cabfa7ad5bd0cec62/href">https://medium.com/media/ef462e50212ba97cabfa7ad5bd0cec62/href</a></iframe><pre><strong>Output:</strong></pre><pre>{}</pre><ul><li>Eğer <strong>del() </strong>ile sözlüğü dilersek sözlük tamamen kaldırılır ve ulaşılamaz olur.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6e94797b4a5f01abac1b17b35cdfa510/href">https://medium.com/media/6e94797b4a5f01abac1b17b35cdfa510/href</a></iframe><pre><strong>Output:</strong></pre><pre><strong>--------------------------------------------------------------------</strong><br><strong>NameError</strong>                         Traceback (most recent call last)<br><br><br><strong>NameError</strong>: name &#39;ogrenci_bilgileri&#39; is not defined</pre><ul><li><strong>popitem()</strong> en son eklenen elemanı siler.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/314f08dc8240a68acb867e050a620725/href">https://medium.com/media/314f08dc8240a68acb867e050a620725/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5123cabe6be2e8a9f6606cd91843085c/href">https://medium.com/media/5123cabe6be2e8a9f6606cd91843085c/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;öğrenci_adı&#39;: &#39;Dilara&#39;, &#39;numara&#39;: 21311405, &#39;mezuniyet_yılı&#39;: 2019}</pre><ul><li><strong>pop()</strong> ise belirttiğimiz anahtarın ve karşılık gelen değerin silinmesini sağlar.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/492bf71e7f039e5dcd878bb06f42f752/href">https://medium.com/media/492bf71e7f039e5dcd878bb06f42f752/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;öğrenci_adı&#39;: &#39;Dilara&#39;, &#39;mezuniyet_yılı&#39;: 2019}</pre><ul><li><strong>pop()</strong> ile olmayan bir anahtarı silmeye çalışırsak hata alırız.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/75d2f0afb418dcde1336ee1ec3d0e681/href">https://medium.com/media/75d2f0afb418dcde1336ee1ec3d0e681/href</a></iframe><pre><strong>Output:</strong></pre><pre><strong>--------------------------------------------------------------------</strong><br><strong>KeyError</strong>                      Traceback (most recent call last)<br><br><br><strong>KeyError</strong>: &#39;numara&#39;</pre><ul><li>Bir anahtarın varlığını sette olduğu gibi yine <strong>not in </strong>ile kontrol etmemiz mümkündür.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5cc53af6dc7f47ef39ffe9bb3ac5e813/href">https://medium.com/media/5cc53af6dc7f47ef39ffe9bb3ac5e813/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;Selim&#39;: 2, &#39;Büşra&#39;: 4, &#39;Mert&#39;: 4, &#39;Şule&#39;: 3, &#39;Başak&#39;: 5, &#39;Gülsüm&#39;: 4}</pre><figure><a href="https://raw.githubusercontent.com/badicev/PythonEgitim/main/png-setoperators2.jpg"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AxxRBE7JPkm4iP1AYNkyVw.jpeg" /></a></figure><blockquote>update() ile:</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ded20fd81e0ebf999a1aee9b242aabaa/href">https://medium.com/media/ded20fd81e0ebf999a1aee9b242aabaa/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;Selim&#39;: 2, &#39;Büşra&#39;: 4, &#39;Mert&#39;: 5, &#39;Şule&#39;: 4, &#39;Başak&#39;: 5, &#39;Gülsüm&#39;: 4}<br>{&#39;Gülsüm&#39;: 4, &#39;Mert&#39;: 5, &#39;Şule&#39;: 4}</pre><blockquote>** ile:</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c147a9842e75530744d7abb9a087e78e/href">https://medium.com/media/c147a9842e75530744d7abb9a087e78e/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;Selim&#39;: 2, &#39;Büşra&#39;: 4, &#39;Mert&#39;: 5, &#39;Şule&#39;: 4, &#39;Başak&#39;: 5, &#39;Gülsüm&#39;: 4}</pre><figure><a href="https://github.com/badicev/PythonEgitim/blob/main/png-setoperators3.jpg?raw=true"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A32ytljnZuxoK_fZK9okSA.jpeg" /></a></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5ac639c0a4202f741a0780ba5ecc8fc/href">https://medium.com/media/b5ac639c0a4202f741a0780ba5ecc8fc/href</a></iframe><pre><strong>Output:</strong></pre><pre>{1: &#39;Max Richter&#39;,<br> 2: &#39;Hans Zimmer&#39;,<br> 3: &#39;Ludovico Einaudi&#39;,<br> 4: &#39;Pyotr Ilyich Tchaikovsky&#39;,<br> 5: &#39;Gustav Mahler&#39;}</pre><blockquote><strong>copy() </strong>ile</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3005e5090adcd2d75a25a68ef92b80a2/href">https://medium.com/media/3005e5090adcd2d75a25a68ef92b80a2/href</a></iframe><pre><strong>Output:</strong></pre><pre>{1: &#39;Max Richter&#39;, 2: &#39;Hans Zimmer&#39;, 3: &#39;Ludovico Einaudi&#39;, 4: &#39;Pyotr Ilyich Tchaikovsky&#39;, 5: &#39;Gustav Mahler&#39;, 6: &#39;Yann Tiersen&#39;}<br>{1: &#39;Max Richter&#39;, 2: &#39;Hans Zimmer&#39;, 3: &#39;Ludovico Einaudi&#39;, 4: &#39;Pyotr Ilyich Tchaikovsky&#39;, 5: &#39;Gustav Mahler&#39;}</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/97bd8267d8186629b74093a1a03ebcf6/href">https://medium.com/media/97bd8267d8186629b74093a1a03ebcf6/href</a></iframe><pre><strong>Output:</strong></pre><pre>{1: &#39;Max Richter&#39;, 2: &#39;Hans Zimmer&#39;, 3: &#39;Ludovico Einaudi&#39;, 4: &#39;Pyotr Ilyich Tchaikovsky&#39;, 5: &#39;Gustav Mahler&#39;, 6: &#39;Yann Tiersen&#39;}<br>{1: &#39;Max Richter&#39;, 2: &#39;Hans Zimmer&#39;, 3: &#39;Ludovico Einaudi&#39;, 4: &#39;Pyotr Ilyich Tchaikovsky&#39;, 5: &#39;Gustav Mahler&#39;, 6: &#39;Yann Tiersen&#39;}</pre><blockquote><strong>dict()</strong> ile:</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d309a1fe5cb50aaeaeca5dbfe5355d54/href">https://medium.com/media/d309a1fe5cb50aaeaeca5dbfe5355d54/href</a></iframe><pre><strong>Output:</strong></pre><pre>{1: &#39;Max Richter&#39;, 2: &#39;Hans Zimmer&#39;, 3: &#39;Ludovico Einaudi&#39;, 4: &#39;Pyotr Ilyich Tchaikovsky&#39;, 5: &#39;Gustav Mahler&#39;, 6: &#39;Yann Tiersen&#39;}<br>{1: &#39;Max Richter&#39;, 2: &#39;Hans Zimmer&#39;, 3: &#39;Ludovico Einaudi&#39;, 4: &#39;Pyotr Ilyich Tchaikovsky&#39;, 5: &#39;Gustav Mahler&#39;}</pre><ul><li>Bir sözlükten iki adet köşeli parantez kullanarak ve parantezlerin içerisinde anahtarın yolunu belirtirsek ilgili değere ulaşabiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bdb92952a38f464e58e3788a0025f7ab/href">https://medium.com/media/bdb92952a38f464e58e3788a0025f7ab/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;isim&#39;: &#39;Başak&#39;,<br> &#39;GSM&#39;: &#39;054xxxxxxx&#39;,<br> &#39;eposta&#39;: &#39;basak.cevik@hacettepe.edu.tr&#39;,<br> &#39;adres&#39;: {&#39;İl&#39;: &#39;Ankara&#39;, &#39;ilçe&#39;: &#39;Çankaya&#39;, &#39;Semt&#39;: &#39;Ümitköy&#39;}}</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c42ddea921cc260719a09ae7286f7394/href">https://medium.com/media/c42ddea921cc260719a09ae7286f7394/href</a></iframe><pre><strong>Output:</strong></pre><pre>&#39;Ümitköy&#39;</pre><ul><li>Sözlükteki anahtarları, değerleri, anahtar-değer ikilisini<strong> sorted()</strong> ile sıraya sokabiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c71d9b693b4fa7fcbc484d42427e71c7/href">https://medium.com/media/c71d9b693b4fa7fcbc484d42427e71c7/href</a></iframe><pre><strong>Output:</strong></pre><pre>[2, 3, 4, 5, 9]<br>[(2, &#39;Max Richter&#39;), (3, &#39;Ludovico Einaudi&#39;), (4, &#39;Gustav Mahler&#39;), (5, &#39;Hans Zimmer&#39;), (9, &#39;Pyotr Ilyich Tchaikovsky&#39;)]<br>[&#39;Gustav Mahler&#39;, &#39;Hans Zimmer&#39;, &#39;Ludovico Einaudi&#39;, &#39;Max Richter&#39;, &#39;Pyotr Ilyich Tchaikovsky&#39;]</pre><ul><li>Tersten sıralamak için ise yine <strong>sorted()</strong> kullanıp<em> reverse boolean</em>ını True olarak verebiliriz.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/20436177a4da833a019ae362be6e884a/href">https://medium.com/media/20436177a4da833a019ae362be6e884a/href</a></iframe><pre><strong>Output:</strong></pre><pre>[9, 5, 4, 3, 2]<br>[(9, &#39;Pyotr Ilyich Tchaikovsky&#39;), (5, &#39;Hans Zimmer&#39;), (4, &#39;Gustav Mahler&#39;), (3, &#39;Ludovico Einaudi&#39;), (2, &#39;Max Richter&#39;)]<br>[&#39;Pyotr Ilyich Tchaikovsky&#39;, &#39;Max Richter&#39;, &#39;Ludovico Einaudi&#39;, &#39;Hans Zimmer&#39;, &#39;Gustav Mahler&#39;]</pre><blockquote><strong>Örnek 1:</strong> Anahtar değerlerin uzunlukları kadar değerine ekleme yapalım:</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9731b9c03825ebdc0479f0946daf73f9/href">https://medium.com/media/9731b9c03825ebdc0479f0946daf73f9/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;hidrojen&#39;: 9, &#39;oksijen&#39;: 15, &#39;helyum&#39;: 8, &#39;karbon&#39;: 12}</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8d200c6fc161e5cf5cfd0bf59a34a13/href">https://medium.com/media/c8d200c6fc161e5cf5cfd0bf59a34a13/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;Seda&#39;: 23, &#39;Tuba&#39;: 38, &#39;Cemre&#39;: 22, &#39;Faruk&#39;: 21, &#39;Fatma&#39;: 29}</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4c3033fe917570c98d4e858a9f1a287/href">https://medium.com/media/c4c3033fe917570c98d4e858a9f1a287/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;Seda&#39;: 23, &#39;Tuba&#39;: 38, &#39;Cemre&#39;: 22, &#39;Faruk&#39;: 21, &#39;Fatma&#39;: 29}</pre><p>Kapsamlı bir sözlük olsa dahi köşeli parantezleri kullanarak değere erişebiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae075e7ffbb1b12d3679d98232557db4/href">https://medium.com/media/ae075e7ffbb1b12d3679d98232557db4/href</a></iframe><pre><strong>Output:</strong></pre><pre>0</pre><blockquote><strong>Örnek 2:</strong><em> İki listeyi birleştirip bir sözlük oluşturalım:</em></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/effb0c0fdcf478719bac25a85448cf00/href">https://medium.com/media/effb0c0fdcf478719bac25a85448cf00/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;Ankara&#39;: 6, &#39;İzmir&#39;: 35, &#39;Kars&#39;: 36}</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfa463688b4fc6d002ac451ae49ba22b/href">https://medium.com/media/cfa463688b4fc6d002ac451ae49ba22b/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;Ankara&#39;: 6, &#39;İzmir&#39;: 35, &#39;Kars&#39;: 36}</pre><blockquote><strong>Örnek 3:</strong> <em>Sözlükte verilen anahtar-değer ikililerini arasında ‘_’ olacak şekilde güncelleyelim:</em></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e32a58db33d1a4e36d54ede4fb2bcf9e/href">https://medium.com/media/e32a58db33d1a4e36d54ede4fb2bcf9e/href</a></iframe><pre><strong>Output:</strong></pre><pre>{&#39;Karsu&#39;: &#39;sonunda&#39;,<br> &#39;BLOOM&#39;: &#39;still&#39;,<br> &#39;The Irrepressibles&#39;: &#39;in_this_shirt&#39;,<br> &#39;Lindsey Stirling&#39;: &#39;electric_daisy_violin&#39;,<br> &#39;Ari Barokas&#39;: &#39;yaşıyorum_sil_baştan&#39;}</pre><p>Veri yapılarının hepsini inceledik. Umarım verimli olmuştur. Bir sonraki Python yazısında görüşmek üzere.😊🦊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*0RuCpBf1jZVZBe-5jiSvDA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb41b81ce61b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>