Upload code
This commit is contained in:
19
ExamStuff/Aufgabe 7 Prfg Spirale.py
Executable file
19
ExamStuff/Aufgabe 7 Prfg Spirale.py
Executable file
@@ -0,0 +1,19 @@
|
||||
from turtle import*
|
||||
shape("turtle")
|
||||
color("blue")
|
||||
|
||||
distance = 10
|
||||
pu()
|
||||
|
||||
for i in range(2):
|
||||
fd(distance)
|
||||
rt(20)
|
||||
orientation = heading()
|
||||
stamp()
|
||||
while orientation > 0:
|
||||
orientation = heading()
|
||||
fd(distance)
|
||||
rt(20)
|
||||
stamp()
|
||||
distance += 2
|
||||
print(orientation)
|
6
ExamStuff/Prüfung Testfile.py
Executable file
6
ExamStuff/Prüfung Testfile.py
Executable file
@@ -0,0 +1,6 @@
|
||||
seconds = 70512
|
||||
minutes = seconds // 60
|
||||
seconds_rest = minutes % 60
|
||||
hours = minutes // 60
|
||||
minutes_rest = minutes % 60
|
||||
print(hours, minutes_rest, seconds_rest)
|
28
ExamStuff/prfg Aufgabe 8 Cross.py
Executable file
28
ExamStuff/prfg Aufgabe 8 Cross.py
Executable file
@@ -0,0 +1,28 @@
|
||||
from turtle import*
|
||||
import math
|
||||
|
||||
rt(45)
|
||||
go = 1
|
||||
color("red")
|
||||
|
||||
distance_in = int(numinput("Wie weit darf sich die Turtle vom Mittelpunkt entfernen??", " Gerade Zahl von 1-unendlich ",300,minval=1))
|
||||
|
||||
for i in range(4):
|
||||
go = 1
|
||||
while go == 1:
|
||||
fd(50)
|
||||
dot(25)
|
||||
x = xcor()
|
||||
y = ycor()
|
||||
distance = math.sqrt((x**2) + (y**2))
|
||||
if distance >= distance_in:
|
||||
go = 0
|
||||
else:
|
||||
if distance <= -distance_in:
|
||||
go = 0
|
||||
|
||||
else:
|
||||
go = 1
|
||||
|
||||
bk(distance_in)
|
||||
rt(90)
|
Reference in New Issue
Block a user