31 lines
597 B
Python
31 lines
597 B
Python
import turtle
|
|
|
|
length = int(input("Laenge: "))
|
|
width = int(input("Breite: "))
|
|
color = str(input("Farbe (R/G/B): "))
|
|
|
|
if length > 100 or width > 100:
|
|
length = round(length / 10)
|
|
width = round(width / 10)
|
|
print(f"Massstab 1:10 angewandt. Neue Laenge {length}, Neue Breite {width}")
|
|
|
|
t = turtle.Turtle()
|
|
|
|
match color.lower():
|
|
case "r":
|
|
t.fillcolor("red")
|
|
case "g":
|
|
t.fillcolor("green")
|
|
case "b":
|
|
t.fillcolor("blue")
|
|
|
|
t.begin_fill()
|
|
for _ in range(2):
|
|
t.forward(length)
|
|
t.left(90)
|
|
t.forward(width)
|
|
t.left(90)
|
|
t.end_fill()
|
|
|
|
turtle.done()
|