python turtle loop

Ich versuche, erstellen Sie eine Schleife Quadrat, und kann nicht herausfinden, wie man meinem code, mir zu erlauben, wiederholen Sie den Befehl erstellen Quadraten, multipliziert mit der Anzahl input, heres, was ich derzeit habe.

square_count = input("Enter the number of squares to draw: ")
count_int = int(square_ct)

if count_int > 1:

    turtle.begin_fill()
    turtle.forward(100)
    turtle.right(90)
    turtle.forward(100)
    turtle.right(90)
    turtle.forward(100)
    turtle.right(90)
    turtle.forward(100)
    turtle.end_fill()

    turtle.up()
    turtle.forward(20)
    turtle.color(random.random(),random.random(), random.random())
InformationsquelleAutor Ryan Tice | 2012-09-15
Schreibe einen Kommentar