{"componentChunkName":"component---src-pages-author-author-yaml-id-js","path":"/author/sara-lins/","result":{"data":{"allMarkdownRemark":{"edges":[{"node":{"id":"8d2ac0aa-3d4b-5906-9ad9-388948762f05","html":"<p>Python is a general-purpose programming language and has overtaken Java in popularity according to a recent Stackoverflow survey. </p>\n<p>People who have never programmed before are tempted to try due to the simplicity to learn and use it. Well, let's get down to business.</p>\n<h2 id=\"before-we-get-started\" style=\"position:relative;\"><a href=\"#before-we-get-started\" aria-label=\"before we get started permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Before we get started</h2>\n<p>Before we get started, there are a few things you should know about python:</p>\n<ul>\n<li>Python is a high-level programming language, which means it has a strong abstraction from the computer's details (that's why it's so easy and understandable). Because of that, it may be not so efficient as other languages like assembly, C, or C++;</li>\n<li>Python is an interpreted language. Its syntax is read and then executed directly. The interpreter reads each program statement, following the program flow, then decides what to do and does it. That's why you should test all your programs, even if everything seems to be working correctly. If there is an error within a loop, for example, it will only be shown if the loop is executed;</li>\n<li>Python has excellent documentation <a href=\"https://docs.python.org/3/\">that you can access here</a> and an incredible community. Use them.</li>\n</ul>\n<h2 id=\"print-function\" style=\"position:relative;\"><a href=\"#print-function\" aria-label=\"print function permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Print function</h2>\n<p><em>We are assuming that you have already installed python. If you do not, please click <a href=\"https://www.python.org/downloads/\">here</a>.</em></p>\n<p>To write your first Python code, open your text editor and type: </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">print(&quot;Hello world, this is my first python code&quot;)</span></code></pre>\n<p>Save the file as <code>helloworld.py</code> and put it into the python interpreter to be executed.\nYou also can run your code on the command line:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\Users\\Your Name&gt;python helloworld.py</span></code></pre>\n<p>If everything went well, you should see something like this:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&gt; Hello world, this is my first python code</span></code></pre>\n<p>You can also use the print function to show integers, variables, lists, etc. Try it!</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">#show the sum of two integers</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">number1 = </span><span class=\"mtk7\">5</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">number2 = </span><span class=\"mtk7\">7</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">print</span><span class=\"mtk1\">(number1+number2)</span></span></code></pre>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">#dividing two decimals</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">number1 = </span><span class=\"mtk10\">float</span><span class=\"mtk1\">(</span><span class=\"mtk7\">12.1</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">number2 = </span><span class=\"mtk10\">float</span><span class=\"mtk1\">(</span><span class=\"mtk7\">4</span><span class=\"mtk1\">)</span></span></code></pre>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">#concatenating strings</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">name = </span><span class=\"mtk8\">&quot;Python&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">phrase = </span><span class=\"mtk10\">str</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;I hate &quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">print</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;I love &quot;</span><span class=\"mtk1\">, name)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">print</span><span class=\"mtk1\">(phrase+name)</span></span></code></pre>\n<h2 id=\"data-types\" style=\"position:relative;\"><a href=\"#data-types\" aria-label=\"data types permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Data Types</h2>\n<p>Python has the following data types built-in by default, in these categories:</p>\n<ul>\n<li>Text Type:\t<code>str</code> <em>(string)</em></li>\n<li>Numeric Types:\t<code>int</code> <em>(integer)</em>, <code>float</code> <em>(decimal)</em>, <code>complex</code></li>\n<li>Sequence Types:\t<code>list</code>, <code>tuple</code>, <code>range</code></li>\n<li>Mapping Type:\t<code>dict</code></li>\n<li>Set Types:\t<code>set</code>, <code>frozenset</code></li>\n<li>Boolean Type:\t<code>bool</code></li>\n<li>Binary Types:\t<code>bytes</code>, <code>bytearray</code>, <code>memoryview</code></li>\n</ul>\n<blockquote>\n<p><strong>Note:</strong> Variables in Python are interpreted as integers by default. Is a good practice to declare them as another type <em>explicitly</em> (if they aren't integers). You can see the kind of a variable using the function <code>type()</code>.</p>\n</blockquote>\n<h2 id=\"python-operators\" style=\"position:relative;\"><a href=\"#python-operators\" aria-label=\"python operators permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Python Operators</h2>\n<p>Operators are used to performing operations on variables and values.\nThe main groups are:</p>\n<ul>\n<li>Arithmetic operators</li>\n<li>Comparison operators</li>\n<li>Logical operators</li>\n</ul>\n<h3 id=\"arithmetic-operators\" style=\"position:relative;\"><a href=\"#arithmetic-operators\" aria-label=\"arithmetic operators permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Arithmetic operators</h3>\n<p><em>Arithmetic operators are used with numeric values to perform common mathematical operations.</em></p>\n<ul>\n<li><strong>Addition</strong>:\t<code>x + y</code></li>\n<li><strong>Subtraction:</strong> <code>x - y</code></li>\n<li><strong>Multiplication:</strong> <code>x * y</code></li>\n<li><strong>Division:</strong> <code>x / y</code></li>\n<li><strong>Modulus:</strong> <code>x % y</code>\t</li>\n<li><strong>Exponentiation:</strong> <code>x ** y</code>\t</li>\n<li><strong>Floor division:</strong> <code>x // y</code></li>\n</ul>\n<h3 id=\"comparison-operators\" style=\"position:relative;\"><a href=\"#comparison-operators\" aria-label=\"comparison operators permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Comparison operators</h3>\n<p><em>Comparison operators are used to compare two values.</em></p>\n<ul>\n<li><strong>Equal:</strong> <code>x == y</code></li>\n<li><strong>Not equal:</strong> <code>x != y</code></li>\n<li><strong>Greater than:</strong> <code>x > y</code></li>\n<li><strong>Less than:</strong> <code>x &#x3C; y</code>\t</li>\n<li><strong>Greater than or equal to:</strong> <code>x >= y</code></li>\n<li><strong>Less than or equal to:</strong>\t<code>x &#x3C;= y</code></li>\n</ul>\n<h3 id=\"logical-operators\" style=\"position:relative;\"><a href=\"#logical-operators\" aria-label=\"logical operators permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Logical operators</h3>\n<p><em>Logical operators are used to combine conditional statements.</em></p>\n<ul>\n<li><strong>and</strong> -> Returns True if both statements are true\n<code>x &#x3C; 2 and x &#x3C; 4</code></li>\n<li><strong>or</strong> ->\tReturns True if one of the statements is true\n<code>x &#x3C; 10 or x &#x3C; 9</code></li>\n<li><strong>not</strong> -> Reverse the result, returns False if the result is true\n<code>not(x &#x3C; 2 and x &#x3C; 4)</code></li>\n</ul>\n<h2 id=\"if-statement\" style=\"position:relative;\"><a href=\"#if-statement\" aria-label=\"if statement permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>If statement</h2>\n<p>Look to the code below:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">age = </span><span class=\"mtk7\">18</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> (age&lt;</span><span class=\"mtk7\">21</span><span class=\"mtk1\">):</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">print</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;The student is underage!&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">elif</span><span class=\"mtk1\"> (age==</span><span class=\"mtk7\">21</span><span class=\"mtk1\">):</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">print</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;The student is 21!&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">else</span><span class=\"mtk1\">:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">print</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;The student isn&#39;t underage!&quot;</span><span class=\"mtk1\">)</span></span></code></pre>\n<p>In programming, we often have to choose what to do depending on the situation. It is essential to know how to use conditional arguments like <code>if</code>and <code>else</code>.\nThe code above print a different message according to a condition.</p>\n<p>Try to write a code that asks for two test scores. If the average is less than 7, the user should see \"I'm sorry, you didn't do well on the tests\". If the average is exactly 7, the user should see \"You did it!\". And if it is greater than 7, the user should see \"Congratulations!! You're a great student.\".</p>\n<blockquote>\n<p><strong>Note:</strong> to request a response from the user, you need to use the <code>input()</code> function. For example:</p>\n</blockquote>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">name = </span><span class=\"mtk10\">str</span><span class=\"mtk1\">(</span><span class=\"mtk11\">input</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;What&#39;s your name?&quot;</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">age = </span><span class=\"mtk10\">int</span><span class=\"mtk1\">(</span><span class=\"mtk11\">input</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;How old are you? &quot;</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">print</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;I&#39;m </span><span class=\"mtk4\">%s</span><span class=\"mtk8\"> and I&#39;m </span><span class=\"mtk4\">%d</span><span class=\"mtk8\">&quot;</span><span class=\"mtk1\">% (name, age))</span></span></code></pre>\n<h2 id=\"loops\" style=\"position:relative;\"><a href=\"#loops\" aria-label=\"loops permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Loops</h2>\n<p>Python has two primitive loop commands: <code>while</code> and <code>for</code>.</p>\n<h3 id=\"while-loop\" style=\"position:relative;\"><a href=\"#while-loop\" aria-label=\"while loop permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>While loop</h3>\n<p><em>With the while loop, we can execute a set of statements as long as a condition is true.</em></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">count = </span><span class=\"mtk7\">0</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">while</span><span class=\"mtk1\"> count &lt; </span><span class=\"mtk7\">10</span><span class=\"mtk1\">:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">print</span><span class=\"mtk1\">(count)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    count += </span><span class=\"mtk7\">1</span><span class=\"mtk1\">    </span><span class=\"mtk3\">#this line is the same as    count = count+1</span></span></code></pre>\n<p>The code above will print count as long as count is less than 10.</p>\n<h3 id=\"for-loop\" style=\"position:relative;\"><a href=\"#for-loop\" aria-label=\"for loop permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>For loop</h3>\n<p>A for loop is used for iterating over a sequence. Using it, we can execute a set of statements, once for each item in a list, tuple, set, string, etc. For example:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">#loop through a string</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">for</span><span class=\"mtk1\"> x </span><span class=\"mtk4\">in</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;banana&quot;</span><span class=\"mtk1\">:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">print</span><span class=\"mtk1\">(x)</span></span></code></pre>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">#loop through a list of fruits</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">fruits = [</span><span class=\"mtk8\">&quot;apple&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;banana&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;melon&quot;</span><span class=\"mtk1\">]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">for</span><span class=\"mtk1\"> x </span><span class=\"mtk4\">in</span><span class=\"mtk1\"> fruits:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">print</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;I like&quot;</span><span class=\"mtk1\">, x)</span></span></code></pre>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>Did you understand why python became so popular? In a few minutes, you were able to learn the main concepts of this fantastic language.</p>\n<p>Please comment and share this article!</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n</style>","frontmatter":{"title":"Python basics in minutes","author":{"id":"Sara Lins","github":"saranicoly","avatar":null},"date":"November 06, 2020","updated_date":null,"tags":["Python"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/c09f9fd01e129e30049747717eaf81ec/ee604/python.png","srcSet":"/static/c09f9fd01e129e30049747717eaf81ec/69585/python.png 200w,\n/static/c09f9fd01e129e30049747717eaf81ec/497c6/python.png 400w,\n/static/c09f9fd01e129e30049747717eaf81ec/ee604/python.png 800w,\n/static/c09f9fd01e129e30049747717eaf81ec/f3583/python.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}}},"fields":{"authorId":"Sara Lins","slug":"/engineering/python-basics-in-minutes/"}}}]},"authorYaml":{"id":"Sara Lins","bio":"I'm a computer engineering student passionate about technology and how it can change people's lives.","github":"saranicoly","stackoverflow":null,"linkedin":"sara-nicoly-66b2b0157","medium":null,"twitter":null,"avatar":null}},"pageContext":{"id":"Sara Lins","__params":{"id":"sara-lins"}}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}