Question: Write two functions, triangle ( ) and nestedTriangle ( ) . Both functions take two parameters: a turtle and an edge length. The pseudocode for
Write two functions, triangle and nestedTriangle Both functions take two parameters: a turtle and an edge length. The pseudocode for triangle is:
trianglet length:
If length :
Repeat times:
Move t the turtle, forward length steps.
Turn t left degrees.
Call triangle with t and length
The pseudocode for nestedTriangle is very similar:
nestedTrianglet length:
If length :
Repeat times:
Move t the turtle, forward length steps.
Turn t left degrees.
Call nestedTriangle with t and length
A template program, nestingTrianges.py is available here on GitHub. The grading script does not run the whole program, but instead tests your function separately unit tests' to determine correctness. As such, the function names must match exactly else the scripts cannot find it Make sure to use the function names from the GitHub program it is expecting triangle and nestedTriangle
A sample run:
Enter edge length:
which would produce:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
