The Joy of Programming
Thinking in Loops
There is no preview available for this lesson. Please join the course to access it. Click here to enroll.
Questions
ANSWER FOR 7.8
JE Joswin Emmanuel
3 years ago
Post
Dismiss
i=1 for x in [-125,-75,-25,25,75,125]: r=50 show(rectangle(x,0,r,r)) for j in range(1,i+1): show(rectangle(x,0,r*(j/i),r*(j/i))) i+=1
i=1 for x in [-125,-75,-25,25,75,125]: r=50 show(rectangle(x,0,r,r)) for j in range(1,i+1): show(rectangle(x,0,r*(j/i),r*(j/i))) i+=1
KL Khadeeja lubaba
3 years ago
Post
Dismiss
Help with exercise 7.8
Help with exercise 7.8
DP Dhanush P N
3 years ago
Post
Dismiss
##7.6 ```python def make_eye(width, index, count): n = index+1 return ellipse(w=width, h=width/2) + circle(r=width/4, fill='black') ```
##7.6 ```python def make_eye(width, index, count): n = index+1 return ellipse(w=width, h=width/2) + circle(r=width/4, fill='black') ```
DP Dhanush P N
3 years ago
Post
Dismiss
##7.7 def make_redeye(width, index, count): n = index+1 red = 255*index/(count-1) fill = color(r=red, g=0, b=0) return ellipse(w=width, h=width/2) + circle(r=width/4, fill=fill, stroke='none'
##7.7 def make_redeye(width, index, count): n = index+1 red = 255*index/(count-1) fill = color(r=red, g=0, b=0) return ellipse(w=width, h=width/2) + circle(r=width/4, fill=fill, stroke='none'
DP Dhanush P N
3 years ago
Post
Dismiss
##7.7 ```python def make_redeye(width, index, count): n = index+1 red = 255*index/(count-1) fill = color(r=red, g=0, b=0) return ellipse(w=width, h=width/2) + circle(r=width/4, fill=fill, stroke='none' ```
##7.7 ```python def make_redeye(width, index, count): n = index+1 red = 255*index/(count-1) fill = color(r=red, g=0, b=0) return ellipse(w=width, h=width/2) + circle(r=width/4, fill=fill, stroke='none' ```
DP Dhanush P N
3 years ago
Post
Dismiss
##7.8 ```python def make_concentric_squares(width, index, count): n = index+1 shape = rectangle(w=width, h=width) for i in range(1, n): shape += rectangle(w=(width/n) * i , h=(width/n) * i) return shape ```
##7.8 ```python def make_concentric_squares(width, index, count): n = index+1 shape = rectangle(w=width, h=width) for i in range(1, n): shape += rectangle(w=(width/n) * i , h=(width/n) * i) return shape ```
DP Dhanush P N
3 years ago
Post
Dismiss
##7.9 ```python def make_growing_circles(width, index, count): n = count - index return circle(r=width/(n+1)) ```
##7.9 ```python def make_growing_circles(width, index, count): n = count - index return circle(r=width/(n+1)) ```
ST Shafeek T
3 years ago
Post
Dismiss
7.9 ?
7.9 ?
AE Aiswarya Elizabeth
3 years ago
Post
Dismiss
7.9 please
7.9 please
FS Farhan shabeer
3 years ago
Post
Dismiss
7.5
7.5
Want to discuss?
Post it here, our mentors will help you out.