<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://peda.net/:static/539/atom.xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>5. marraskuuta 2025</title>
<id>https://peda.net/id/1018876eb97</id>
<updated>2025-11-04T13:33:19+02:00</updated>
<link href="https://peda.net/id/1018876eb97:atom" rel="self" />
<link href="https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/5.-marraskuuta-2025#top" rel="alternate" />
<logo>https://peda.net/:static/539/peda.net.logo.bg.svg</logo>
<rights type="html">&lt;div class=&quot;license&quot;&gt;Tämän sivun lisenssi &lt;a rel=&quot;license&quot; href=&quot;https://peda.net/info&quot;&gt;Peda.net-yleislisenssi&lt;/a&gt;&lt;/div&gt;&#10;</rights>

<entry>
<title>Python: while- ja for- rakenteet sekä Turtle-grafiikkakirjasto</title>
<id>https://peda.net/id/4b66e822b97</id>
<updated>2025-11-04T16:57:26+02:00</updated>
<link href="https://peda.net/orivesi/perusopetus/yhteiskoulu/oppiaineet/tietoteknikka/tvt-ja-ohjelmointikurssi-25-26/5.-marraskuuta-2025/python-while-ja-for-rakenteet-seka-turtle-grafiikkakirjasto#top" />
<content type="html">Jatketaan Python-kielen opiskelua. &lt;br/&gt;&#10;&lt;br/&gt;&#10;Tee taas &lt;a href=&quot;https://trinket.io/&quot; rel=&quot;noopener nofollow ugc&quot; target=&quot;_blank&quot;&gt;Trinket.io&lt;/a&gt; -ympäristössä. Käytä haluamaasi tekoälyä apuna.&lt;br/&gt;&#10;&lt;br/&gt;&#10;Keskity tällä kertaa näihin teemoihin ja harjoituksiin:&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;h3&gt;1) Tutustu if - elif - else -rakenteeseen: lue koodi, koeta ymmärtää ja lopuksi kopioi ja kokeile&lt;/h3&gt;&#10;&lt;code&gt;# Kysytään käyttäjältä lämpötila&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;lampotila = input(&amp;quot;Anna tämänhetkinen lämpötila (Celsius): &amp;quot;)&lt;/code&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;code&gt;# Muunnetaan luku kokonaisluvuksi&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;lampotila = int(lampotila)&lt;/code&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;code&gt;# Tarkistetaan, millainen sää on&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;if lampotila &amp;lt; 0:&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  print &amp;quot;Ulkona on pakkasta. Muista takki!&amp;quot;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;elif lampotila &amp;lt; 10:&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  print &amp;quot;On viileää. Tarvitset ehkä hupparin.&amp;quot;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;elif lampotila &amp;lt; 20:&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  print &amp;quot;Sää on melko miellyttävä.&amp;quot;&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;else:&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  print &amp;quot;On lämmintä! Ehkä t-paitakeli.&amp;quot;&lt;/code&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;607&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;622&quot;--&gt;💡 Selitys:&lt;/h3&gt;&#10;&lt;ul&gt;&lt;!--filtered attribute: data-start=&quot;623&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;794&quot;--&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;623&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;677&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;625&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;677&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;625&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;629&quot;--&gt;if&lt;/code&gt; tarkistaa ensimmäisen ehdon (&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;659&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;674&quot;--&gt;lampotila &amp;lt; 0&lt;/code&gt;)&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;678&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;743&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;680&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;743&quot;--&gt;Jos se ei toteudu, siirrytään &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;710&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;716&quot;--&gt;elif&lt;/code&gt;-ehtoihin yksi kerrallaan&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;744&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;794&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;746&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;794&quot;--&gt;Jos mikään ehto ei toteudu, suoritetaan &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;786&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;792&quot;--&gt;else&lt;/code&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;br/&gt;&#10;&lt;h3&gt;Tehtävät&lt;/h3&gt;&#10;1a) Kopioi edellinen koodi ja kokeile sen toiminta. Tallenna tämä tiedosto nimellä &lt;code&gt;if_rakenne&lt;/code&gt;. Lisää uusia lämpötilarajoja (esim. “todella kuuma” tai “jääkylmä”)&lt;br/&gt;&#10;1b) Pyydä tekoälyä auttamaan lisäämään ohjelmaan myös &lt;strong&gt;&lt;!--filtered attribute: data-start=&quot;970&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;982&quot;--&gt;säätilan&lt;/strong&gt; kysyminen (“onko aurinkoista vai sateista?”).&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;h3&gt;2) Tutustu Turtle- grafiikkakirjaston avulla while-silmukkaan&lt;/h3&gt;&#10;Lue koodi. Koeta ymmärtää, mitä pystyt. Kopioi sitten ja kokeile ajaa sitä Trinketissä. Tallenna nimellä &lt;code&gt;turtle_ja_while&lt;/code&gt;.&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;code&gt;# Ladataan grafiikkakirjasto. Sen nimi on turtle.&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;from turtle import *&lt;/code&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;code&gt;# Luodaan Turtle-tyyppinen olio, jonka avulla piirretään.&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;nuoli = Turtle()&lt;/code&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;code&gt;# Toistetaan ikuisesti silmukkaa&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;while(True):&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  kulmaVasempaan=int(input(&amp;quot;Anna kulma vasemmalle: &amp;quot;))&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  eteneminen=int(input(&amp;quot;Paljonko edetään:&amp;quot;))&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  nuoli.left(kulmaVasempaan)&lt;/code&gt;&lt;br/&gt;&#10;&lt;code&gt;  nuoli.forward(eteneminen)&lt;/code&gt;&lt;br/&gt;&#10;&lt;br/&gt;&#10;Tässä while-silmukan alussa ei ole normaalisti olevaa ehdon voimmassaolon tarkistamista.&lt;br/&gt;&#10;Vaan while-silmukkaa tekemällä on laadittu ikuisesti jatkuva ohjelmisto. Sen voi siis keskeyttää ainoastaan &amp;quot;väkivaltaisesti&amp;quot;.&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;h3&gt;3) Perhdy Turtle-grafiikkaan enemmän&lt;/h3&gt;&#10;&lt;br/&gt;&#10;Lue seuraava kuvaus (1-6) pohjaksi rupeaksesi tekemään Turtle-grafiikalla erilaisia tehtäviä.&lt;br/&gt;&#10;&lt;br/&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;292&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;306&quot;--&gt;1. Aloitus&lt;/h3&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-python&quot;&gt;&lt;span&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; turtle&#10;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;337&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;405&quot;--&gt;Tämä tuo kirjaston käyttöön.&lt;br/&gt;&#10;&lt;!--filtered attribute: data-start=&quot;365&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;368&quot;--&gt;Sen jälkeen voit luoda “kilpikonnan”:&lt;/p&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-python&quot;&gt;&lt;span&gt;t = turtle.Turtle()&#10;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;hr&gt;&lt;/hr&gt;&lt;!--filtered attribute: data-start=&quot;442&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;445&quot;--&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;447&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;465&quot;--&gt;2. Liikkuminen&lt;/h3&gt;&#10;&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&#10;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot;&gt;&#10;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot;&gt;&lt;!--filtered attribute: data-start=&quot;467&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;748&quot;--&gt;&#10;&lt;thead&gt;&lt;!--filtered attribute: data-start=&quot;467&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;500&quot;--&gt;&#10;&lt;tr&gt;&lt;!--filtered attribute: data-start=&quot;467&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;500&quot;--&gt;&#10;&lt;th&gt;&lt;!--filtered attribute: data-start=&quot;467&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;477&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;Komento&lt;/th&gt;&#10;&lt;th&gt;&lt;!--filtered attribute: data-start=&quot;477&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;487&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;Selitys&lt;/th&gt;&#10;&lt;th&gt;&lt;!--filtered attribute: data-start=&quot;487&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;500&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;Esimerkki&lt;/th&gt;&#10;&lt;/tr&gt;&#10;&lt;/thead&gt;&#10;&lt;tbody&gt;&lt;!--filtered attribute: data-start=&quot;538&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;748&quot;--&gt;&#10;&lt;tr&gt;&lt;!--filtered attribute: data-start=&quot;538&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;594&quot;--&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-start=&quot;538&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;557&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;540&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;556&quot;--&gt;t.forward(100)&lt;/code&gt;&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;557&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;589&quot;--&gt;liikkuu eteenpäin 100 askelta&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;589&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;594&quot;--&gt;→&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&lt;!--filtered attribute: data-start=&quot;595&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;643&quot;--&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-start=&quot;595&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;614&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;597&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;613&quot;--&gt;t.backward(50)&lt;/code&gt;&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;614&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;638&quot;--&gt;taaksepäin 50 askelta&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;638&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;643&quot;--&gt;←&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&lt;!--filtered attribute: data-start=&quot;644&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;695&quot;--&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-start=&quot;644&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;660&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;646&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;659&quot;--&gt;t.right(90)&lt;/code&gt;&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;660&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;690&quot;--&gt;kääntyy oikealle 90 astetta&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;690&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;695&quot;--&gt;↷&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&lt;!--filtered attribute: data-start=&quot;696&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;748&quot;--&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-start=&quot;696&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;711&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;698&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;710&quot;--&gt;t.left(45)&lt;/code&gt;&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;711&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;743&quot;--&gt;kääntyy vasemmalle 45 astetta&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;743&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;748&quot;--&gt;↶&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;hr&gt;&lt;/hr&gt;&lt;!--filtered attribute: data-start=&quot;750&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;753&quot;--&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;755&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;787&quot;--&gt;3. Piirtäminen ja nostaminen&lt;/h3&gt;&#10;&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&#10;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot;&gt;&#10;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot;&gt;&lt;!--filtered attribute: data-start=&quot;789&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;947&quot;--&gt;&#10;&lt;thead&gt;&lt;!--filtered attribute: data-start=&quot;789&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;810&quot;--&gt;&#10;&lt;tr&gt;&lt;!--filtered attribute: data-start=&quot;789&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;810&quot;--&gt;&#10;&lt;th&gt;&lt;!--filtered attribute: data-start=&quot;789&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;799&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;Komento&lt;/th&gt;&#10;&lt;th&gt;&lt;!--filtered attribute: data-start=&quot;799&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;810&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;Selitys&lt;/th&gt;&#10;&lt;/tr&gt;&#10;&lt;/thead&gt;&#10;&lt;tbody&gt;&lt;!--filtered attribute: data-start=&quot;835&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;947&quot;--&gt;&#10;&lt;tr&gt;&lt;!--filtered attribute: data-start=&quot;835&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;888&quot;--&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-start=&quot;835&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;849&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;837&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;848&quot;--&gt;t.penup()&lt;/code&gt;&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;849&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;888&quot;--&gt;nostaa kynän (ei piirrä liikkuessa)&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&lt;!--filtered attribute: data-start=&quot;889&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;947&quot;--&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-start=&quot;889&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;905&quot;--&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;code&gt;&lt;!--filtered attribute: data-start=&quot;891&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;904&quot;--&gt;t.pendown()&lt;/code&gt;&lt;/td&gt;&#10;&lt;td&gt;&lt;!--filtered attribute: data-col-size=&quot;sm&quot;--&gt;&lt;!--filtered attribute: data-start=&quot;905&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;947&quot;--&gt;laskee kynän alas (alkaa taas piirtää)&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;hr&gt;&lt;/hr&gt;&lt;!--filtered attribute: data-start=&quot;949&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;952&quot;--&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;954&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;984&quot;--&gt;4. Värit ja viivan paksuus&lt;/h3&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-python&quot;&gt;&lt;span&gt;t.color(&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;blue&amp;quot;&lt;/span&gt;)&#10;t.pensize(&lt;span class=&quot;hljs-number&quot;&gt;3&lt;/span&gt;)&#10;t.forward(&lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1045&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1112&quot;--&gt;🎨 Värit: &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;1055&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1062&quot;--&gt;&amp;quot;red&amp;quot;&lt;/code&gt;, &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;1064&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1072&quot;--&gt;&amp;quot;blue&amp;quot;&lt;/code&gt;, &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;1074&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1083&quot;--&gt;&amp;quot;green&amp;quot;&lt;/code&gt;, &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;1085&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1094&quot;--&gt;&amp;quot;black&amp;quot;&lt;/code&gt;, &lt;code&gt;&lt;!--filtered attribute: data-start=&quot;1096&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1106&quot;--&gt;&amp;quot;yellow&amp;quot;&lt;/code&gt;, jne.&lt;/p&gt;&#10;&lt;hr&gt;&lt;/hr&gt;&lt;!--filtered attribute: data-start=&quot;1114&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1117&quot;--&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;1119&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1143&quot;--&gt;5. Kuvioita helposti&lt;/h3&gt;&#10;&lt;!--filtered tag: &lt;h4--&gt;&lt;!--filtered attribute: data-start=&quot;1145&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1155&quot;--&gt;&lt;!--&amp;gt;--&gt;Neliö&lt;!--filtered end tag: &lt;/h4&gt;--&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-python&quot;&gt;&lt;span&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;hljs-keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;range&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;4&lt;/span&gt;):&#10;&lt;br/&gt;&#10;  t.forward(&lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;)&#10;&lt;br/&gt;&#10;  t.right(&lt;span class=&quot;hljs-number&quot;&gt;90&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;!--filtered tag: &lt;h4--&gt;&lt;!--filtered attribute: data-start=&quot;1225&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1236&quot;--&gt;&lt;!--&amp;gt;--&gt;Kolmio&lt;!--filtered end tag: &lt;/h4&gt;--&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-python&quot;&gt;&lt;span&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;hljs-keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;range&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;3&lt;/span&gt;): &lt;br/&gt;&#10;  t.forward(&lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;)&#10;&lt;br/&gt;&#10;  t.left(&lt;span class=&quot;hljs-number&quot;&gt;120&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;hr&gt;&lt;/hr&gt;&lt;!--filtered attribute: data-start=&quot;1306&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1309&quot;--&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;1311&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1325&quot;--&gt;6. Lopuksi&lt;/h3&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-python&quot;&gt;&lt;span&gt;turtle.done()&#10;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1356&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1404&quot;--&gt;Tämä pitää ikkunan auki, kunnes suljet sen itse.&lt;/p&gt;&#10;&lt;hr&gt;&lt;/hr&gt;&lt;!--filtered attribute: data-start=&quot;1406&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1409&quot;--&gt;&#10;&lt;h3&gt;&lt;!--filtered attribute: data-start=&quot;1411&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1426&quot;--&gt;💡 Vinkkejä&lt;/h3&gt;&#10;&lt;ul&gt;&lt;!--filtered attribute: data-start=&quot;1427&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1612&quot;--&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;1427&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1465&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1429&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1465&quot;--&gt;Kokeile eri kulmia ja etäisyyksiä.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;1466&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1522&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1468&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1522&quot;--&gt;Tee omia kuvioita yhdistämällä silmukoita ja värejä.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;!--filtered attribute: data-start=&quot;1523&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1612&quot;--&gt;&#10;&lt;p&gt;&lt;!--filtered attribute: data-start=&quot;1525&quot;--&gt;&lt;!--filtered attribute: data-end=&quot;1582&quot;--&gt;Jos menee sekaisin, voit aina aloittaa alusta komennolla:&lt;/p&gt;&#10;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&#10;&lt;div class=&quot;sticky top-9&quot;&gt;&#10;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&#10;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-python&quot;&gt;&lt;span&gt;t.reset()&#10;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;br/&gt;&#10;&lt;h3&gt;4) Tee seuraavia Turtle-tehtäviä:&lt;/h3&gt;&#10;&lt;br/&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Piirrä for-silmukkaa apuna käyttäen säännöllinen viisikulmio. Tallenna nimellä &lt;code&gt;viisikulmio&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;Piirrä for-silmukkaa apuna käyttäen säännöllinen kuusikulmio. Tallenna nimellä &lt;code&gt;kuusikulmio&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;Piirrä for-silmukkaa apuna käyttäen säännöllinen satakulmio. Tallenna nimellä &lt;code&gt;satakulmio&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;Piirrä Daavidin tähti. Tallenna nimellä &lt;code&gt;daavidin_tahti&lt;/code&gt;. &lt;/li&gt;&#10;&lt;li&gt;Keksi itse jokin piirros. Tallenna nimellä &lt;code&gt;oma_piirros&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Tutki tekoälyn avulla, voisitko tehdä jonkin pelin (esim. matopeli, Pacman, tms. ) Turtle-grafiikalla (ei ole tietoa, onko mahdollista).&lt;/li&gt;&#10;&lt;/ol&gt;</content>
<published>2025-11-04T13:49:18+02:00</published>
</entry>


</feed>