<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Victoria Adesanmi</title>
    <description>The latest articles on DEV Community by Victoria Adesanmi (@dev_vee).</description>
    <link>https://dev.to/dev_vee</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2652925%2F1d1d570e-ef33-4f68-99a9-c12d72684bf4.png</url>
      <title>DEV Community: Victoria Adesanmi</title>
      <link>https://dev.to/dev_vee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dev_vee"/>
    <language>en</language>
    <item>
      <title>Functions, variables, and debugging; Restarting my DS, AI &amp; ML Journey</title>
      <dc:creator>Victoria Adesanmi</dc:creator>
      <pubDate>Fri, 03 Jan 2025 20:01:24 +0000</pubDate>
      <link>https://dev.to/dev_vee/functions-variables-and-debugging-restarting-my-ds-ai-ml-journey-21fa</link>
      <guid>https://dev.to/dev_vee/functions-variables-and-debugging-restarting-my-ds-ai-ml-journey-21fa</guid>
      <description>&lt;p&gt;Building awesome stuff has always excited me and while I’ve tried learning low-key, it’s time I leveraged public accountability for better results. &lt;/p&gt;

&lt;p&gt;Today, I review the basic concepts of Python, here are the top insights I got;&lt;/p&gt;

&lt;h3&gt;
  
  
  I’m beginning to ask deeper questions.
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Why doesn’t this code work if I tweak it this way?&lt;/strong&gt; Asking such questions even though I’ll still resolve the issue helped me understand how code processing systems work, which is relevant for problem solving or debugging. &lt;/p&gt;

&lt;h3&gt;
  
  
  Functions
&lt;/h3&gt;

&lt;p&gt;These are basically blocks of code that execute a particular task. You can call them later on to display a result. The example below shows a variable, x, containing “awesome.” That’s a global variable. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbhaciai0xop4sq2n5np.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbhaciai0xop4sq2n5np.png" alt="Image description" width="420" height="208"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I created a function, myfunc(), and created another variable x, this time, containing “fantastic.” This is a local variable because its within a function. When I call myfunc(), the output would be “Python is fantastic,” but when I call the in-built python function, the output would be “Python is awesome” because that function is not within the previous function. Amazing rightttt!&lt;/p&gt;

&lt;p&gt;It gets better. If I add the global keyword to var x within the defined function, the in-built function will retire the previous global variable and set the local one to be global. &lt;/p&gt;

&lt;h4&gt;
  
  
  Debugging:
&lt;/h4&gt;

&lt;p&gt;I found that if you define print as a function, and add a line of code for an in-built print function to display a result, and then call the first print function, you create an infinite loop of print calling itself over and over again leading to a recursion error. That made me ask myself, what if it was a normal code and the function was different, what actually terminates the call process? Found out that its the in-built print responsible for displaying result. So my experiment was an infinite loop because right after the in-built print terminates, print() calls it again and the process begins over again. &lt;/p&gt;

&lt;p&gt;Whew! By the way, I’ll also be reading books on AI &amp;amp; ML as I proceed. Thanks for reading.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>python</category>
    </item>
  </channel>
</rss>
