generated from mwc/lab_iteration
CHECKPOINT 1 - make square with list
Hello! So yes, it was a little difficult, but not impossible. I think CS is mostly about logic and mathematics (or that's how i feel right now). I knew it would need a list within the definition but I thought putting a '4' as a motion would be the solution to do the motion 4x. Except it didn't. So then I reread the lab instructions and I guessed it would need 4 '1's to get completed. And that worked! So not actually that difficult to figure out but you need to use your brain. I'm just thinking it doesn't feel super intuitive to me yet, but I'm sure this will come with more practice! We just started haha.
This commit is contained in:
14
square.py
14
square.py
@@ -1,14 +1,12 @@
|
|||||||
from turtle import *
|
from turtle import *
|
||||||
|
|
||||||
def square(side_length):
|
def square(side_length):
|
||||||
forward(side_length)
|
|
||||||
right(90)
|
motions = [1,1,1,1]
|
||||||
forward(side_length)
|
for motion in motions:
|
||||||
right(90)
|
forward(side_length)
|
||||||
forward(side_length)
|
right(90)
|
||||||
right(90)
|
|
||||||
forward(side_length)
|
|
||||||
right(90)
|
|
||||||
|
|
||||||
sizes = [20, 40, 60, 80, 100]
|
sizes = [20, 40, 60, 80, 100]
|
||||||
for size in sizes:
|
for size in sizes:
|
||||||
|
Reference in New Issue
Block a user