Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

what is the relationship between the draw_triangle fucntion and the sierpinski function? Collapse Recursion -> Lab - Recursion Lab 3 import turtle t = turtle.

what is the relationship between the draw_triangle fucntion and the sierpinski function? image text in transcribed
image text in transcribed
Collapse Recursion -> Lab - Recursion Lab 3 import turtle t = turtle. Turtle t.speed(10) def sierpinski(length, n): if n == 1: draw_triangle(length) else: sierpinski(length, n-1) trt(120) t.fd(length * 2**(n-2)) sierpinski(length, n-1) t.It(120) t.fd(length * 2**(n-2)) sierpinski(length, n-1) t.fd(length * 2**(n-2) def draw_triangle(length): t.setheading(180) for i in range(3): t.t(120) t.fd(length) sierpinski(20,4) turtle mainloop Lab Question What is the relationship between the draw_triangle function and the sierpinski function? sierpinski is a helper function for draw_triangle draw_triangle is a helper function for sierpinski draw_triangle is declared inside sierpinski draw_triangle is called as a parameter for the sierpinski function Check it

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions

Question

What color should you use to show favorable metrics?

Answered: 1 week ago

Question

Which companys ratios match Column page 441 C?

Answered: 1 week ago