✏️
Codasium
  • Welkom bij Codasium!
  • Handleiding
  • Moduleoverzicht
  • Module 1.1 - Hedy
  • Module 1.2 Van Hedy naar Python
    • Opdracht 1
    • Opdracht 2
  • Module 2.1 - Geschiedenis quiz
    • Les 1
      • Les 1a
      • Les 1b
    • Les 2
      • Les 2a
      • Les 2b
    • Les 3
      • Les 3a
      • Les 3b
    • Les 4
      • Les 4a
      • Les 4b
    • Les 5
      • Les 5a
      • Les 5b
    • Les 6
      • Les 6b
    • Les 7
      • Les 7a
      • Les 7b
  • Module 2.2 - PyGame Quiz
    • Les 1
      • Les 1b
    • Les 2
      • Les 2a
      • Les 2b
    • Les 3
      • Les 3a
      • Les 3b
    • Les 4
      • Les 4a
      • Les 4b
    • Les 5
      • Les 5a
      • Les 5b
    • Les 6
      • Les 6a
      • Les 6b
    • Les 7
      • Les 7a
      • Les 7b
    • Les 8
      • Les 8a
      • Les 8b
    • TODOs
  • Module 2.3 - Pygame Biologie
    • Les 1
      • Les 1a
      • Les 1b
    • Les 2
      • Les 2a
      • Les 2b
    • Les 3
      • Les 3a
      • Les 3b
    • Les 4
      • Les 4b
    • Les 5
      • Les 5b
  • Module 2.4 - Rekenmachine
    • Les 1
      • Les 1a
      • Les 1b
    • Les 2
      • Les 2a
      • Les 2b
    • Les 3
      • Les 3a
      • Les 3b
    • Les 4
      • Les 4a
      • Les 4b
    • Les 5
      • Les 5a
      • Les 5b
    • Les 6
      • Les 6a
      • Les 6b
    • Les 7 (extra)
      • Les 7a
      • Les 7b
  • Module 2.5 - Microbit
  • Module 2.6 - Creative Coding
    • Les 1a
    • Les 1b
    • Les 2a
    • Les 2b
  • Module 3.1 - Spreadsheets
    • Les 1
      • Les 1b
    • Les 2
      • Les 2b
    • Les 3
      • Les 3b
    • Les 4
      • Les 4b
    • Les 5
      • Les 5b
    • Les 6 en 7
      • Les 6b
    • Les 8 - Eindopdracht
      • Les 8b
  • Module 3.2 - Databases
    • Les 1
      • Les 1b
    • Les 2
      • Les 2b
    • Les 3
      • Les 3b
    • Les 4
      • Les 4b
    • Les 5
      • Les 5b
    • Les 6
      • Les 6b
    • Les 7
      • Les 7b
    • Les 8
      • Les 8b
  • Module 3.3 - TkInter Rekenmachine
    • Les 1
      • Les 1a
      • Les 1b
    • Les 2
      • Les 2a
      • Les 2b
    • Les 3
      • Les 3b
    • Les 4
      • Les 4b
    • Les 5
      • Les 5b
    • Les 6
      • Les 6b
    • Les 7
      • Les 7b
    • Les 8
      • Les 8b
  • Module 3.4 - TKinter Woordenoefenapp
    • Les 1
      • Les 1b
    • Les 2
      • Les 2b
    • Les 3
      • Les 3b
    • Les 4
      • Les 4b
    • Les 5
      • Les 5b
    • Les 6
      • Les 6b
    • Les 7
      • Les 7b
    • Les 8
      • Les 8b
  • Module 3.5 - Arduino
    • Les 1
      • Les 1b
    • Les 2
      • Les 2b
    • Les 3
      • Les 3b
    • Les 4
      • Les 4b
    • Les 5
      • Les 5b
    • Les 6
      • Les 6b
    • Les 7
      • Les 7b
    • Les 8
      • Les 8b
  • Module 4.1 - JavaScript
    • Les 1
      • Les 1b
    • Les 2
      • Les 2b
    • Les 3
      • Les 3b
    • Les 4
      • Les 4b
    • Les 5
      • Les 5b
    • Les 6
      • Les 6b
    • Les 7
      • Les 7b
    • Les 8
      • Les 8b
  • Module 4.2 - Game maken
  • Module 4.3 - EU app (TODO)
  • Module 5.1 - Eigen project
  • Module 5.2 - Generatieve AI
    • Les 1
      • Les 1a
      • Les 1b
    • Les 2
      • Les 2a
      • Les 2b
    • Les 3
      • Les 3a
      • Les 3b
    • Les 4
      • Les 4a
      • Les 4b
  • Module 6.1 - Boekenproject
    • Les 1 - Leeswijzer - Basis
    • Les 2 - Leeswijzer - Verdieping
    • Les 3 - Opdrachten
    • Les 4 - Opdrachten
  • Module 6.2 - Algoritmiek
  • 💤Archief
    • Module 1.1 - Nederlands
      • Spiekbrief
        • Spiekbrief - in te vullen
        • Spiekbrief - ingevuld
      • Les 1
        • Les 1a
        • Les 1b
      • Les 2
        • Les 2a
        • Les 2b
      • Les 3
        • Les 3a
        • Les 3b
      • Les 4
        • Les 4a
        • Les 4b
      • Les 5
        • Les 5a
        • Les 5b
      • Eindopdracht
        • Eindopdracht
      • Nakijkbladen
        • Les 1
        • Les 2
        • Les 3
        • Les 4
        • Les 5
    • Module 1.2 - Kunst
      • Les 1
        • Les 1a
        • Les 1b
      • Les 2
        • Les 2a
        • Les 2b
      • Les 3
        • Les 3a
        • Les 3b
      • Les 4
        • Les 4a
        • Les 4b
      • Les 5
        • Les 5a
        • Les 5b
      • Eindopdracht
        • Les 6b
      • Nakijkbladen
        • Les 1
        • Les 2
        • Les 3
        • Les 4
        • Les 5
    • Module 4.1 - Flask
      • Les 1
        • Les 1b
      • Les 2
        • Les 2b
      • Les 3
        • Les 3b
      • Les 4
        • Les 4b
      • Les 5
        • Les 5b
Powered by GitBook
On this page
  • Lussen en variabelen
  • Even opfrissen
  • Variabelen in een lus

Was this helpful?

  1. Archief
  2. Module 1.2 - Kunst
  3. Les 4

Les 4a

Lussen en variabelen

Aan het einde van de les kun jij:

  • Dat variabelen ook getallen kunnen zijn

  • Hoe we variabelen gebruiken bij het tekenen

  • Hoe we variabelen gebruiken samen met lussen

Even opfrissen

1) Wat tekenen deze codes? Let op! De codes kunnen ook fout zijn! Schrijf dan FOUT.

1.
for i in range(3):
  pen.forward(100)
  pen.left(120)
2.
for i in range(5)
  pen.forward(100)
  pen.left(60)
3.
for i in range(3):
pen.forward(100)
pen.left(90)
4.
for i in range(5):
  pen.forward(100)
  pen.left(45)

2) Welke codes horen bij deze tekeningen? 1.

Variabelen in een lus

1) Wat tekenen deze codes?

1.
aantal_keer = 4
for i in range(aantal_keer):
  pen.forward(100)
  pen.left(90)
2.
hoek = 120
for i in range(3):
  pen.forward(100)
  pen.left(hoek)
3.
aantal_keer = 6
grootte = 100
for i in range(aantal_keer):
  pen.forward(grootte)
  pen.left(60)
4.
aantal_keer = 6
hoek = 60
for i in range(aantal_keer):
  pen.forward(50)
  pen.left(hoek)
5.
aantal_keer = 3
hoek = 60
for i in range(aantal_keer):
  pen.forward(50)
  pen.left(hoek)
6.
aantal_hoeken = 8
hoek = 360/aantal_hoeken
for i in range(aantal_hoeken):
  pen.forward(50)
  pen.left(hoek)
  1. Leg nu in woorden uit wat de code van code 6 (hier direct boven) doet.

8.
namen = 3
for i in range(namen):
  print('Hallo')
9.
namen = 3
klas = '1c'
for i in range(namen):
  print('Hallo', klas)
10.
namen = 3
groet = 'Goedemorgen'
klas = '1c'
for i in range(namen):
  print(groet, klas)

2) Wat tekenen deze codes? Let op: Er kunnen nu ook foutjes in de codes zitten!

1.
aantal_keer = 4
for i in range(aantal_keer)
  pen.forward(100)
  pen.left(90)
2.
aantal_keer = 4
for i in range(aantal_hoeken)
  pen.forward(100)
  pen.left(90)
3.
aantal_keer = 6
grootte = 100
for i in range(4):
  pen.forward(100)
  pen.left(60)
4.
aantal_keer = 5
hoek = 72
for i in range(aantal_keer):
  pen.forward(100)
  pen.left(hoek)
5.
aantal_hoeken = 8
hoek = 360/aantal_hoeken   # / betekent gedeeld door in Python
for i in range(aantal_hoeken):
pen.forward(50)
pen.left(hoek)
6.
aantal_keer = 3
hoek = 60
for i in range(aantal_keer):
  pen.forward(50)
  pen.left(hoek)
  1. Leg in woorden uit wat de code van opdracht 6 doet.

8.
namen = 3
klas = '1c'
for i in range(klas):
print('Hallo', klas)

3) Wat tekenen deze codes?

1.
hoeken = 3
for i in range(hoeken):
  pen.forward(100)
  pen.left(120)

pen.forward(100)

for i in range(hoeken):
  pen.forward(100)
  pen.left(120)
2.
grootte = 100
for i in range(4):
  pen.forward(grootte)
  pen.left(90)

pen.penup()
pen.forward(grootte)
pen.pendown()

for i in range(4):
  pen.forward(grootte)
  pen.left(90)
3. (Ja deze code is echt anders dan de code van 2 hoor. Kijk goed!)
grootte = 100
for i in range(3):
  pen.forward(grootte)
  pen.left(120)

pen.penup()
pen.forward(grootte/2)   # / betekent gedeeld door in Python
pen.pendown()

for i in range(3):
  pen.forward(grootte)
  pen.left(120)
4.
grootte = 100
for i in range(6):
  pen.forward(grootte)
  pen.left(60)

pen.penup()
pen.forward(grootte)
pen.pendown()

grootte = 50

for i in range(3):
  pen.forward(grootte)
  pen.left(120)
PreviousLes 4NextLes 4b

Last updated 3 years ago

Was this helpful?

💤