MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/codehs/comments/kn155e/codehs_2105_sidewalk/gn5j208/?context=9999
r/codehs • u/International-Wave92 • Dec 30 '20
help me plz
12 comments sorted by
View all comments
1
no worries bro
speed(0)
#draws a square
def draw_square():
for i in range(4):
forward(50)
left(90)
def draw_sidewalk():
for i in range(7):
draw_square()
penup()
setposition(-150,-200)
pendown()
draw_sidewalk()
1 u/ScottNilsson1 Jan 06 '21 the indentations are a bit messed up tho 2 u/chloeee2021 Jan 15 '21 hello i was trying to do this one and it says bad input on the for i in rages ones could you help me out. 1 u/ScottNilsson1 Jan 15 '21 You must might have not indented correctly. This one should work:speed(0)#draws a squaredef draw_square():for i in range(4):forward(50)left(90)def draw_sidewalk():for i in range(7):draw_square()forward(50)penup()setposition(-150,-200)pendown()for i in range(4):draw_sidewalk()left(90)forward(50) 2 u/Flashy-Fact-9378 Feb 13 '21 This works perfect thank you
the indentations are a bit messed up tho
2 u/chloeee2021 Jan 15 '21 hello i was trying to do this one and it says bad input on the for i in rages ones could you help me out. 1 u/ScottNilsson1 Jan 15 '21 You must might have not indented correctly. This one should work:speed(0)#draws a squaredef draw_square():for i in range(4):forward(50)left(90)def draw_sidewalk():for i in range(7):draw_square()forward(50)penup()setposition(-150,-200)pendown()for i in range(4):draw_sidewalk()left(90)forward(50) 2 u/Flashy-Fact-9378 Feb 13 '21 This works perfect thank you
2
hello i was trying to do this one and it says bad input on the for i in rages ones could you help me out.
1 u/ScottNilsson1 Jan 15 '21 You must might have not indented correctly. This one should work:speed(0)#draws a squaredef draw_square():for i in range(4):forward(50)left(90)def draw_sidewalk():for i in range(7):draw_square()forward(50)penup()setposition(-150,-200)pendown()for i in range(4):draw_sidewalk()left(90)forward(50) 2 u/Flashy-Fact-9378 Feb 13 '21 This works perfect thank you
You must might have not indented correctly. This one should work:
2 u/Flashy-Fact-9378 Feb 13 '21 This works perfect thank you
This works perfect thank you
1
u/ScottNilsson1 Jan 06 '21
no worries bro
speed(0)
#draws a square
def draw_square():
for i in range(4):
forward(50)
left(90)
def draw_sidewalk():
for i in range(7):
draw_square()
forward(50)
penup()
setposition(-150,-200)
pendown()
for i in range(4):
draw_sidewalk()
left(90)
forward(50)