{"id":83,"date":"2024-10-11T23:34:15","date_gmt":"2024-10-12T03:34:15","guid":{"rendered":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/?p=83"},"modified":"2024-10-20T14:52:16","modified_gmt":"2024-10-20T18:52:16","slug":"beginner-coding-python","status":"publish","type":"post","link":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/2024\/10\/11\/beginner-coding-python\/","title":{"rendered":"Beginner Coding &#8211; Python"},"content":{"rendered":"\n<p>For this assignment I learnt the basics to coding. I previously competed with EV3 and I am equipped with a little bit of python coding skills. For review I decided to used a platform called replit.com and went through a tutorial called the 100 days of coding. Obviously, I didn\u2019t have 100 days to complete the tutorial so I used it as as an easy review for my assignment.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"513\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-2-1024x513.png\" alt=\"\" class=\"wp-image-86\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-2-1024x513.png 1024w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-2-300x150.png 300w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-2-768x385.png 768w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-2-1536x770.png 1536w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-2-2048x1026.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Replit is a really nice platform for learning python, the tutorials were easy to understand and engaging, it also has an AI function that assists you while you code. <\/p>\n\n\n\n<p>After some review, I figured I would code an age sorter that would label the user\u2019s age as either child, adult and then ask for their favorite number. <\/p>\n\n\n\n<p><strong><em>Flow of the code:<\/em><\/strong><\/p>\n\n\n\n<p>Introduction: Greetings and ask for name and age<\/p>\n\n\n\n<p>First function: Sort age into either adult, or child, or neither<\/p>\n\n\n\n<p>Second function: Ask for favorite number then sort into even or odd<\/p>\n\n\n\n<p>End: Thanks for using the code!<\/p>\n\n\n\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<figure class=\"wp-block-image alignleft size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1010\" height=\"525\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-4.png\" alt=\"\" class=\"wp-image-88\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-4.png 1010w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-4-300x156.png 300w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-4-768x399.png 768w\" sizes=\"auto, (max-width: 1010px) 100vw, 1010px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>The code starts with an introduction then proceeds to gather the user&#8217;s name and age. It then saves the number and name into a variable and uses an if, else loop to determine the age bracket of the user. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"322\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-5-1024x322.png\" alt=\"\" class=\"wp-image-89\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-5-1024x322.png 1024w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-5-300x94.png 300w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-5-768x242.png 768w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-5.png 1055w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, the check_favorite_number function gathers the user&#8217;s number, saves it in a variable, then divides by 2 to determine if the number is even or odd.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"717\" height=\"289\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-6.png\" alt=\"\" class=\"wp-image-90\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-6.png 717w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-6-300x121.png 300w\" sizes=\"auto, (max-width: 717px) 100vw, 717px\" \/><\/figure>\n\n\n\n<p>This is the last part of the function which runs the entire program and defines the function. It also ends the program with a print of the name gathered earlier.<\/p>\n\n\n\n<p>This is the full code demonstrated<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-8-1024x662.png\" alt=\"\" class=\"wp-image-92\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-8-1024x662.png 1024w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-8-300x194.png 300w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-8-768x496.png 768w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-8-1536x993.png 1536w, https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-content\/uploads\/sites\/9\/2024\/10\/image-8.png 1849w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Coding seems to be a lot easier then the other assignments so far as the tutorial programs are more helpful and also applies a lot of logic and common sense. <\/p>\n\n\n\n<p>Come try it out yourself!<\/p>\n\n\n\n<p><a href=\"https:\/\/replit.com\/join\/qwjmiwlkfe-joshuachen271\">https:\/\/replit.com\/join\/qwjmiwlkfe-joshuachen271<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For this assignment I learnt the basics to coding. I previously competed with EV3 and I am equipped with a little bit of python coding skills. For review I decided to used a platform called replit.com and went through a tutorial called the 100 days of coding. Obviously, I didn\u2019t have 100 days to complete [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-codingdigitalspace"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/comments?post=83"}],"version-history":[{"count":3,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":103,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/posts\/83\/revisions\/103"}],"wp:attachment":[{"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/joshuac\/wp-json\/wp\/v2\/tags?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}