kicoku:kicokusommer2023
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| kicoku:kicokusommer2023 [2023/08/14 09:59] – [Zahlen Variablen] newo | kicoku:kicokusommer2023 [2023/11/24 19:42] (aktuell) – [KiCoKu Sommer 2023] newo | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== KiCoKu Sommer 2023 ====== | + | ====== KiCoKu Sommer 2023 ====== |
| - | ===== Python ===== | + | |
| + | Dieser Bereich basiert auf dem Buch "Teach your kids to code" from Bryson Pane und dem folgenden Udemy Kurs | ||
| + | https:// | ||
| + | Dieser Kurs ist zwar auf Englisch, aber sehr leicht zu verstehen. | ||
| + | |||
| + | Dauer: Mo. 28.8 bis Fr. 1.9 | ||
| + | Von 9:00 bis 13:00 | ||
| + | |||
| + | Teilnehmer: Felix G, Markus, Paul, Felix E | ||
| + | ===== Python | ||
| Installation: | Installation: | ||
| Zeile 52: | Zeile 61: | ||
| </ | </ | ||
| + | ===== Python Abschnitt 2 - Zeichnen ===== | ||
| ==== Erstes Ziel Sechs Eckige Spirale ==== | ==== Erstes Ziel Sechs Eckige Spirale ==== | ||
| Unser erstes Ziel, eine sechseckige Spirale zeichnen lassen. | Unser erstes Ziel, eine sechseckige Spirale zeichnen lassen. | ||
| Zeile 313: | Zeile 323: | ||
| </ | </ | ||
| {{: | {{: | ||
| - | ==== Text zeichnen | + | ==== Taschenrechner |
| + | < | ||
| + | print(" | ||
| + | # Ask the user to enter a math problem | ||
| + | problem = input(" | ||
| + | |||
| + | # Keep going until the user enters ' | ||
| + | while (problem != " | ||
| + | | ||
| + | # Show the problem, and the answer using eval() | ||
| + | print(" | ||
| + | | ||
| + | # Ask for another math problem | ||
| + | problem = input(" | ||
| + | | ||
| + | # This while loop will keep going until you enter ' | ||
| + | </ | ||
| + | Bildschirmausgabe | ||
| + | < | ||
| + | MathHomework.py | ||
| + | Enter a math problem, or ' | ||
| + | The answer to 5 + 2 is: 7 | ||
| + | Enter another math problem, or ' | ||
| + | The answer to 5 / 2 is: 2.5 | ||
| + | Enter another math problem, or ' | ||
| + | The answer to 5 // 2 is: 2 | ||
| + | Enter another math problem, or ' | ||
| + | The answer to 5 % 2 is: 1 | ||
| + | Enter another math problem, or ' | ||
| + | The answer to (4 + 2) * (2 + 2) is: 24 | ||
| + | Enter another math problem, or ' | ||
| + | </ | ||
| + | ==== Eingabe für die färbige Spirale ==== | ||
| + | < | ||
| + | # ColorSpiralInput.py | ||
| + | import turtle | ||
| + | t = turtle.Pen() | ||
| + | t.speed(0) | ||
| + | turtle.bgcolor(" | ||
| + | # Set up a list of any 8 valid Python color names | ||
| + | colors = [" | ||
| + | " | ||
| + | # Ask the user for the number of sides | ||
| + | sides = int( turtle.numinput(" | ||
| + | " | ||
| + | # Draw a colorful spiral with the user-specified number of sides | ||
| + | for x in range(360): | ||
| + | t.pencolor( colors[x % sides] ) | ||
| + | t.forward( x * 3 / sides + x) | ||
| + | t.left(360 / sides + 1) | ||
| + | t.width(x * sides / 200) | ||
| + | </ | ||
| + | {{: | ||
kicoku/kicokusommer2023.1691999956.txt.gz · Zuletzt geändert: 2023/08/14 09:59 von newo
