{"id":71,"date":"2024-10-23T17:08:12","date_gmt":"2024-10-23T21:08:12","guid":{"rendered":"https:\/\/wp.stgeorges.bc.ca\/felixh\/?p=71"},"modified":"2024-11-30T17:43:08","modified_gmt":"2024-11-30T22:43:08","slug":"how-i-gained-an-understanding-of-python","status":"publish","type":"post","link":"https:\/\/wp.stgeorges.bc.ca\/felixh\/2024\/10\/23\/how-i-gained-an-understanding-of-python\/","title":{"rendered":"how I gained an understanding of Python"},"content":{"rendered":"\n<div class=\"wp-block-columns alignwide are-vertically-aligned-top is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-top is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<p class=\"has-contrast-color has-text-color\" style=\"margin-top:0;margin-right:var(--wp--preset--spacing--20);margin-bottom:0;margin-left:var(--wp--preset--spacing--20);padding-top:0;padding-bottom:0;font-size:clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.542), 1.2rem);\">Hello all! This is my experience learning Python over the past six weeks, ten minutes a day, from September 13th, 2024, to October 24th, 2024, using <a href=\"https:\/\/replit.com\/learn\/100-days-of-python\/hub?utm_source=widget\" data-type=\"link\" data-id=\"https:\/\/replit.com\/learn\/100-days-of-python\/hub?utm_source=widget\" target=\"_blank\" rel=\"noreferrer noopener\">Replit&#8217;s 100 Days of Python<\/a> (Day 1 &#8211; 42). I had little experience with Python at the start of this course, only knowing some other mainstream languages.<\/p>\n<\/div>\n<\/div>\n\n\n\n<details class=\"wp-block-details alignwide is-style-default is-layout-flow wp-container-core-details-is-layout-b15f4bf2 wp-block-details-is-layout-flow\" style=\"font-size:clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.542), 1.2rem);\" open><summary> What I learned<\/summary>\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-d5be0cc4 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> defining and using variables\/lists\/dictionaries<\/summary>\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-84ea13b8 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> variables<\/summary>\n<p>Variables are a way to store a value. The first time I used them was on Day 2 to store user input. I learned that a person doesn&#8217;t need to declare the variable type; instead, Python will infer the type from our assigned value.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--1\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"100\" src=\"http:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-15-at-6.35.33\u202fPM.png\" alt=\"\" class=\"wp-image-111\" style=\"width:516px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-15-at-6.35.33\u202fPM.png 660w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-15-at-6.35.33\u202fPM-300x45.png 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><em>Note: If one requires a variable type, unlike the traditional <code>variableType variableName = value<\/code>, Python uses type casting instead, where <code>variableName = variableType(value)<\/code>.<\/em><\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-84ea13b8 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> lists<\/summary>\n<p>Lists, introduced on day 32, are a way to store multiple values. Lists are very flexible. They can hold as many, or as little items as a person wants. They can also contain different types in a single list. Elements in a list can also be changed (<code>listName[index] = value<\/code>), added (<code>listName.append(item)<\/code>), and removed (<code>listName.remove(item)<\/code>). <\/p>\n\n\n\n<p>The syntax for a list is <code>listName = [item, item, item, etc.]<\/code> or <code>listName = []<\/code> for an empty list<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><em>Note: The index is the placement of the value within a list. It starts from 0, meaning the first value of the list has an index of 0, the second has an index of 1, etc.<\/em><\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-84ea13b8 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> dictionaries<\/summary>\n<p>Dictionaries are very similiar to lists, as they also store multiple values, however, instead of accessing the value using an index, a dictionary does it by a key. Dictionaries were introduced on day 40. The syntax for a dictionary is, as shown below:<\/p>\n\n\n\n<p><code>dictName = {key:value, key:value, etc.]}<\/code> or <code>dictName = {}<\/code> for an empty dictionary<\/p>\n<\/details>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-d5be0cc4 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> using conditional statements (if-then, for loops, etc)<\/summary>\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-d5be0cc4 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> if statements<\/summary>\n<p>If &#8211; else statements were introduced on Day 5. It is a conditional statement that is used to check whether something matches (or doesn&#8217;t) with something, whether that be an integer or a string. I found it very interesting that Python does not use curly brackets {} and instead opts for indenting and colons. The image below also uses nested if statements. It is an if statement in another if statement, which I learned on Day 7.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-rounded is-style-rounded--2\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"507\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-17-at-9.17.32\u202fAM-1-1024x507.png\" alt=\"\" class=\"wp-image-135\" style=\"width:642px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-17-at-9.17.32\u202fAM-1-1024x507.png 1024w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-17-at-9.17.32\u202fAM-1-300x149.png 300w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-17-at-9.17.32\u202fAM-1-768x380.png 768w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-17-at-9.17.32\u202fAM-1.png 1308w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Elif was introduced on Day 6. It is short for else if, and is used when a person needs an additional condition.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-rounded is-style-rounded--3\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"389\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-18-at-11.22.26\u202fAM-1024x389.png\" alt=\"\" class=\"wp-image-138\" style=\"width:642px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-18-at-11.22.26\u202fAM-1024x389.png 1024w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-18-at-11.22.26\u202fAM-300x114.png 300w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-18-at-11.22.26\u202fAM-768x292.png 768w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-18-at-11.22.26\u202fAM.png 1126w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><em>Note: Python uses <code>and<\/code> for two conditions in a single if statement.<\/em><\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-d5be0cc4 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> while loops<\/summary>\n<p><code>while<\/code> loops were introduced on Day 15 and it allows your code to repeat itself based on a condition a person sets. It is similar to an if-statement, except that it allows the code indented to be run over and over until the condition is not satisfied. One must also change the variable in which the condition is used so that it does not result in an infinite loop (aka. <code>counter += 1<\/code> in the code below).<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--4\"><img loading=\"lazy\" decoding=\"async\" width=\"540\" height=\"186\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-27-at-9.01.51\u202fAM.png\" alt=\"\" class=\"wp-image-144\" style=\"width:492px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-27-at-9.01.51\u202fAM.png 540w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/09\/Screenshot-2024-09-27-at-9.01.51\u202fAM-300x103.png 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--5\"><img loading=\"lazy\" decoding=\"async\" width=\"330\" height=\"368\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-14-at-9.00.15\u202fAM.png\" alt=\"\" class=\"wp-image-203\" style=\"width:309px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-14-at-9.00.15\u202fAM.png 330w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-14-at-9.00.15\u202fAM-269x300.png 269w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><\/figure>\n<\/div>\n\n\n\n<p>A <code>while(true)<\/code>loop is a type of while loop that goes on forever until it encounters a <code style=\"font-style: italic\">break<\/code> or <code style=\"font-style: italic\">exit()<\/code>.<\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-d5be0cc4 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> for loops<\/summary>\n<p><code>for<\/code> loops were introduced on Day 19, and are used when a person wants something to run for a specific amount of times.<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--6\"><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"92\" src=\"http:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-01-at-8.47.09\u202fAM.png\" alt=\"\" class=\"wp-image-149\" style=\"width:409px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-01-at-8.47.09\u202fAM.png 542w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-01-at-8.47.09\u202fAM-300x51.png 300w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--7\"><img loading=\"lazy\" decoding=\"async\" width=\"432\" height=\"358\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-01-at-8.47.20\u202fAM.png\" alt=\"\" class=\"wp-image-150\" style=\"width:330px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-01-at-8.47.20\u202fAM.png 432w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-01-at-8.47.20\u202fAM-300x249.png 300w\" sizes=\"auto, (max-width: 432px) 100vw, 432px\" \/><\/figure>\n<\/div>\n\n\n\n<p>The code for a for loop is in the left image above. <code>counter<\/code> is a variable that only exists in the loop, and it acts as a tracker for the loop (from 0 to 9 in this case). The variable does not have to be <code>counter<\/code>, and can be any name. The range can be defined as <code>range(number)<\/code> as shown above or <code>range(startingValue, stoppingValue, increment)<\/code> as shown below.<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--8\"><img loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"98\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-02-at-11.23.45\u202fAM.png\" alt=\"\" class=\"wp-image-154\" style=\"width:418px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-02-at-11.23.45\u202fAM.png 560w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-02-at-11.23.45\u202fAM-300x53.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--9\"><img loading=\"lazy\" decoding=\"async\" width=\"352\" height=\"396\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-02-at-11.23.33\u202fAM.png\" alt=\"\" class=\"wp-image-155\" style=\"width:293px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-02-at-11.23.33\u202fAM.png 352w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-02-at-11.23.33\u202fAM-267x300.png 267w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/figure>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size\"><em>Note: the starting value is inclusive; the ending value is exclusive, hence why it is 101 instead of 100.<\/em><\/p>\n<\/details>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-d5be0cc4 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> definition of functions<\/summary>\n<p>Functions, or subroutines, were introduced on Day 23 and are used when a person needs some code to run multiple times. Instead of copy &amp; pasting that code over and over, it is put inside a function and then called in a program. The syntax for a function is <code>def funcName(parameters):<\/code>, <code>def<\/code> being short for define and <code>parameters<\/code> being the variables\/information that we need for the function to run properly.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--10\"><img loading=\"lazy\" decoding=\"async\" width=\"516\" height=\"174\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-06-at-12.07.21\u202fAM.png\" alt=\"\" class=\"wp-image-165\" style=\"width:370px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-06-at-12.07.21\u202fAM.png 516w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-06-at-12.07.21\u202fAM-300x101.png 300w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><\/figure>\n\n\n\n<p>There do not need to be any parameters passed to the function as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--11\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"302\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-05-at-11.58.29\u202fPM.png\" alt=\"\" class=\"wp-image-163\" style=\"width:517px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-05-at-11.58.29\u202fPM.png 840w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-05-at-11.58.29\u202fPM-300x108.png 300w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-05-at-11.58.29\u202fPM-768x276.png 768w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-84ea13b8 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> user-centred design<\/summary>\n<p>I learned on Day 29 that the <code>print()<\/code> statement, although reckoned as a very simple concept, can actually be quite complicated. There are multiple modifiers that exist for it, such as <code>end=\"\"<\/code> and <code>sep=\"\"<\/code>. It can also use ANSI escape codes to change the color of terminal text as shown in the code below.<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized is-style-rounded is-style-rounded--12\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"829\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-13-at-11.00.30\u202fPM-1024x829.png\" alt=\"\" class=\"wp-image-199\" style=\"width:690px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-13-at-11.00.30\u202fPM-1024x829.png 1024w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-13-at-11.00.30\u202fPM-300x243.png 300w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-13-at-11.00.30\u202fPM-768x621.png 768w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-13-at-11.00.30\u202fPM.png 1048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--13\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"158\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-13-at-10.40.49\u202fPM.png\" alt=\"\" class=\"wp-image-198\" style=\"width:478px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-13-at-10.40.49\u202fPM.png 610w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-13-at-10.40.49\u202fPM-300x78.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/figure>\n<\/div>\n\n\n\n<p>I also use f-strings&#8212;introduced on Day 30&#8212;which make it easy to embed variables or expressions inside a string. They start with the letter <code>f<\/code> before the string and use curly braces <code>{}<\/code> to insert values. For example, <code>f\"{name}\"<\/code> would insert the value of the variable <code>name<\/code> directly into the string. I can also use them for more complex formatting. As shown, <code>{text:^35}<\/code> centers the text in a 35 character space, and {<code>colorChange('red')<\/code>} prints the text in a red color.<\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-style-default is-layout-flow wp-container-core-details-is-layout-d5be0cc4 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> flowcharting<\/summary>\n<p>Flowcharting is the act of planning your code beforehand. It is useful as it allows a person to visually see their logic within complex pieces of code. Here is an example of a flowchart of a theoretical code that signs a person up for an event:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized is-style-rounded is-style-rounded--14\"><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"1024\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-17-at-5.55.50\u202fPM-705x1024.png\" alt=\"\" class=\"wp-image-249\" style=\"width:500px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-17-at-5.55.50\u202fPM-705x1024.png 705w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-17-at-5.55.50\u202fPM-207x300.png 207w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-17-at-5.55.50\u202fPM-768x1115.png 768w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-17-at-5.55.50\u202fPM.png 1052w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/figure>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-container-core-details-is-layout-d5be0cc4 wp-block-details-is-layout-flow\" style=\"padding-right:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><summary> thorough code commenting<\/summary>\n<p>Single-line comments in Python start with the # symbol and extend to the end of the line as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--15\"><img loading=\"lazy\" decoding=\"async\" width=\"538\" height=\"48\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.20.27\u202fAM.png\" alt=\"\" class=\"wp-image-157\" style=\"width:391px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.20.27\u202fAM.png 538w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.20.27\u202fAM-300x27.png 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/figure>\n\n\n\n<p>Multi-line comments use triple quotes and will not interfere with any code:<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--16\"><img loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"262\" src=\"http:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.30.18\u202fAM.png\" alt=\"\" class=\"wp-image-161\" style=\"width:438px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.30.18\u202fAM.png 808w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.30.18\u202fAM-300x97.png 300w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.30.18\u202fAM-768x249.png 768w\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" \/><\/figure>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--17\"><img loading=\"lazy\" decoding=\"async\" width=\"524\" height=\"184\" src=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.27.45\u202fAM.png\" alt=\"\" class=\"wp-image-160\" style=\"width:401px;height:auto\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.27.45\u202fAM.png 524w, https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-content\/uploads\/sites\/11\/2024\/10\/Screenshot-2024-10-04-at-10.27.45\u202fAM-300x105.png 300w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><\/figure>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size\"><em>Note: triple quotes can be interpreted as docstrings instead of a comment if placed immediately after a function or class definition<\/em>.<\/p>\n<\/details>\n<\/details>\n\n\n\n<div class=\"wp-block-columns alignwide is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<p style=\"margin-right:var(--wp--preset--spacing--20);margin-left:var(--wp--preset--spacing--20);font-size:clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.542), 1.2rem);\">This was a very interesting and fun experience learning Python. I was intrigued on how different and similiar it is to other mainstream coding languages such as C++. One emminent example of this is how Python doesn&#8217;t use semicolons at the end of the line. Python, in my opinion, is also more visually pleasing to work with. It has very clean and readable syntax, which is formed using identation instead of curly braces and the tendency to use words instead of symbols. It also has an extensive array of libraries and frameworks&#8212;prewritten code&#8212;that simplify my development.<\/p>\n\n\n\n<p style=\"margin-right:var(--wp--preset--spacing--20);margin-left:var(--wp--preset--spacing--20);font-size:clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.542), 1.2rem);\">Thanks for reading this blog post!<\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-buttons alignwide is-horizontal is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-3576d976 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-25 has-custom-font-size is-style-fill has-medium-font-size\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/wp.stgeorges.bc.ca\/felixh\/\">Back to Home<\/a><\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator alignfull has-alpha-channel-opacity is-style-dots\" \/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello all! This is my experience learning Python over the past six weeks, ten minutes a day, from September 13th, 2024, to October 24th, 2024, using Replit&#8217;s 100 Days of Python (Day 1 &#8211; 42). I had little experience with Python at the start of this course, only knowing some other mainstream languages. This was [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-beginner-projects"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":86,"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":268,"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/posts\/71\/revisions\/268"}],"wp:attachment":[{"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/felixh\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}