1

So here is the thing, im drawing Westminster Palace for my personal project at school, I have already done all the drawing but there is one problem that is making my life a lot harder, I want to create a line of windows in the shortest way so I came up with this:

from turtle import*
for row in range(1):
    for col in range(1,8,2):
        penup()
        setpos(col*50, row*50)
        pendown()
        for i in range(4):
            fd(50)
            lt(90)

it does draw 4 windows in a row just like I would like to, but the problem is that it always starts in the starting position(0,0) and I would like to get it to start drawing at (-335,-195) but I just cant figure out how I would be gratefull if someone would help me with this

1 Answers1

0

You can add before the for loop:

penup()
goto(-335,195)
pendown()

Also there is no point in for row in range(1). You can just define row = 1 instead of having triple nested loops.

cdlane
  • 40,441
  • 5
  • 32
  • 81
  • yes i tried that but because of how my setpos(x,y) is written it will come back to the beginning – Dorian Sesar Jan 17 '17 at 19:12
  • oh i found the solution in setpos(col*50, row*50) i just imported the number where i want it to go so it looks like this(col*50-335, row*50-195), thanks for the tip with row ;) – Dorian Sesar Jan 17 '17 at 19:18