{"id":8659,"date":"2024-10-11T18:53:53","date_gmt":"2024-10-11T23:53:53","guid":{"rendered":"https:\/\/stoccoroy.com\/blog\/?p=8659"},"modified":"2024-10-11T18:55:27","modified_gmt":"2024-10-11T23:55:27","slug":"maggies-first-python-project","status":"publish","type":"post","link":"https:\/\/stoccoroy.com\/blog\/2024\/10\/11\/maggies-first-python-project\/","title":{"rendered":"Maggie&#8217;s First Python Project"},"content":{"rendered":"\n<p>Maggie is taking her first computer science class this year. The seventh grade course meets every other day for half a block (45 minutes) during the first trimester. This isn&#8217;t a lot of time for learning and practice, but students usually dive in with gusto and Maggie is no exception. Although I do teach a section of the class, I don&#8217;t have Maggie. She&#8217;s with my brilliant colleague, Chris Collins. <\/p>\n\n\n\n<p>At the mid point of the first trimester, we ask students to create a short project using the code that they&#8217;ve learned thus far. They are using the Python programming language. Here&#8217;s what Maggie created:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"385\" src=\"https:\/\/i0.wp.com\/stoccoroy.com\/blog\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-08-104603.png?resize=474%2C385&#038;ssl=1\" alt=\"\" class=\"wp-image-8660\" srcset=\"https:\/\/i0.wp.com\/stoccoroy.com\/blog\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-08-104603.png?w=760&amp;ssl=1 760w, https:\/\/i0.wp.com\/stoccoroy.com\/blog\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-08-104603.png?resize=300%2C244&amp;ssl=1 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><figcaption class=\"wp-element-caption\">Maggie&#8217;s program uses the turtle to create a campsite scene.<\/figcaption><\/figure>\n\n\n\n<p>To create this scene, Maggie wrote 170 lines of code using Python&#8217;s default text editor (known as IDLE).  If you&#8217;re curious, the code is appended below. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#project1\n\nimport turtle\nt = turtle.Pen()\nt.speed(0)\nt.screen.bgcolor(\"midnight blue\")\n\n#ground\nt.width(10)\nt.color(\"brown\")\nt.pu()\nt.goto(-200, -161)\nt.pd()\nt.goto(200, -161)\n\n#tree 1\nt.pu()\nt.width(7)\nt.color(\"maroon\")\nt.goto(-190, -160)\nt.pd()\nt.goto(-190, -60)\nt.color(\"forest green\")\nt.goto(-210, -90)\nt.pu()\nt.goto(-190, -60)\nt.pd()\nt.goto(-170, -90)\nt.pu()\nt.goto(-190, -80)\nt.pd()\nt.goto(-210, -110)\nt.pu()\nt.goto(-190, -80)\nt.pd()\nt.goto(-170, -110)\nt.pu()\nt.goto(-190, -100)\nt.pd()\nt.goto(-210, -130)\nt.pu()\nt.goto(-190, -100)\nt.pd()\nt.goto(-170, -130)\nt.pu()\n\n#tree 2\nt.setheading(270)\nt.pu()\nt.fillcolor(\"green\")\nt.pencolor(\"darkgreen\")\nt.goto(100, -90)\nt.pd()\nt.begin_fill()\nt.circle(30)\nt.end_fill()\nt.pu()\nt.goto(120, -120)\nt.pd()\nt.pencolor(\"chocolate1\")\nt.fillcolor(\"burlywood1\")\nt.begin_fill()\nt.forward(40)\nt.left(90)\nt.forward(20)\nt.left(90)\nt.forward(40)\nt.end_fill()\n\n#tent\nt.fillcolor(\"purple1\")\nt.pu()\nt.goto(-50, -160)\nt.pd()\nt.begin_fill()\nt.color(\"purple1\")\nt.goto(40, -160)\nt.goto(20, -110)\nt.goto(-30, -110)\nt.goto(-10, -160)\nt.end_fill()\nt.pu()\nt.fillcolor(\"purple3\")\nt.begin_fill()\nt.goto(-30, -110)\nt.goto(-50, -160)\nt.end_fill()\nt.pu()\nt.color(\"purple1\")\nt.goto(-33, -110)\nt.pd()\nt.goto(-53, -160)\n\n#moon\nt.pu()\nt.goto(110, 50)\nt.pd()\nt.begin_fill()\nt.color(\"old lace\")\nt.circle(50)\nt.end_fill()\n\n#stars\nt.pu()\nt.goto(220, 40)\nt.pd()\nt.color(\"lemon chiffon\")\nt.circle(2)\nt.pu()\nt.goto(220, 90)\nt.pd()\nt.circle(2)\nt.pu()\nt.goto(160, 90)\nt.pd()\nt.circle(2)\nt.pu()\nt.goto(40, 20)\nt.pd()\nt.circle(1)\nt.pu()\nt.goto(20, 20)\nt.pd()\nt.circle(2)\nt.pu()\nt.goto(0, 20)\nt.pd()\nt.circle(3)\nt.pu()\nt.goto(-130, 30)\nt.pd()\nt.circle(2)\nt.pu()\nt.goto(-40, 30)\nt.pd()\nt.circle(1)\nt.pu()\nt.goto(-40, 150)\nt.pd()\nt.circle(2)\nt.pu()\nt.goto(0, 150)\nt.pd()\nt.circle(1)\nt.pu()\nt.goto(0, 190)\nt.pd()\nt.circle(3)\nt.pu()\nt.goto(140, 190)\nt.pd()\nt.circle(2)\nt.pu()\nt.goto(-160, 130)\nt.pd()\nt.circle(1)\nt.pu()\nt.goto(220, 164)\nt.pd()\nt.circle(2)\nt.pu()\nt.goto(-220, 100)\nt.pd()\nt.circle(2)\nt.pu()\nt.goto(-80, -70)\nt.pd()\nt.circle(1)\n\nt.hideturtle()<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maggie is taking her first computer science class this year. The seventh grade course meets every other day for half a block (45 minutes) during the first trimester. This isn&#8217;t a lot of time for learning and practice, but students usually dive in with gusto and Maggie is no exception. Although I do teach a &hellip; <a href=\"https:\/\/stoccoroy.com\/blog\/2024\/10\/11\/maggies-first-python-project\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Maggie&#8217;s First Python Project<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[45],"tags":[130,81,51,65],"class_list":["post-8659","post","type-post","status-publish","format-standard","hentry","category-maggie","tag-coding","tag-maggie","tag-pictures","tag-school"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/posts\/8659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/comments?post=8659"}],"version-history":[{"count":3,"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/posts\/8659\/revisions"}],"predecessor-version":[{"id":8664,"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/posts\/8659\/revisions\/8664"}],"wp:attachment":[{"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/media?parent=8659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/categories?post=8659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stoccoroy.com\/blog\/wp-json\/wp\/v2\/tags?post=8659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}