diff --git a/fejezet 5/5.14.7.py b/fejezet 5/5.14.7.py new file mode 100644 index 0000000..9280e74 --- /dev/null +++ b/fejezet 5/5.14.7.py @@ -0,0 +1,34 @@ +import turtle +def oszlopok(t, magassag): + + t.begin_fill() + t.left(90) + t.forward(magassag) + t.write(" "+ str(magassag)) + t.right(90) + t.forward(40) + t.right(90) + t.forward(magassag) + t.left(90) + t.penup() + t.end_fill() + t.forward(10) + t.pendown() + + +a = turtle.Screen() +a.bgcolor("lightblue") + +Eszti = turtle.Turtle() + +Eszti.speed(100) +Eszti.color("blue", "red") + + + +xs = [48,117,200,240,160,260,220] + +for S in xs: + oszlopok(Eszti, S) + +a.mainloop() \ No newline at end of file diff --git a/fejezet 5/5.14.8.py b/fejezet 5/5.14.8.py new file mode 100644 index 0000000..f1a53b1 --- /dev/null +++ b/fejezet 5/5.14.8.py @@ -0,0 +1,40 @@ +import turtle +def oszlopok(t, magassag): + if (magassag<100): + t.color("green") + elif(magassag<200): + t.color("yellow") + else: + t.color("red") + + t.begin_fill() + t.left(90) + t.forward(magassag) + t.write(" "+ str(magassag)) + t.right(90) + t.forward(40) + t.right(90) + t.forward(magassag) + t.left(90) + t.penup() + t.end_fill() + t.forward(10) + t.pendown() + + +a = turtle.Screen() +a.bgcolor("lightblue") + +Eszti = turtle.Turtle() + +Eszti.speed(100) +Eszti.color("blue", "red") + + + +xs = [48,117,200,240,160,260,220] + +for S in xs: + oszlopok(Eszti, S) + +a.mainloop() \ No newline at end of file diff --git a/fejezet 5/5.14.9.py b/fejezet 5/5.14.9.py new file mode 100644 index 0000000..807d2e4 --- /dev/null +++ b/fejezet 5/5.14.9.py @@ -0,0 +1,40 @@ +import turtle +def oszlopok(t, magassag): + if (magassag<100): + t.color("green") + elif(magassag<200): + t.color("yellow") + else: + t.color("red") + + t.begin_fill() + t.left(90) + t.forward(magassag) + t.write(" "+ str(magassag)) + t.right(90) + t.forward(40) + t.right(90) + t.forward(magassag) + t.left(90) + t.penup() + t.end_fill() + t.forward(10) + t.pendown() + + +a = turtle.Screen() +a.bgcolor("lightblue") + +Eszti = turtle.Turtle() + +Eszti.speed(100) +Eszti.color("blue", "red") + + + +xs = [48,-117,200,-240,-160,260,220] + +for S in xs: + oszlopok(Eszti, S) + +a.mainloop() \ No newline at end of file