Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PYTHON. Need a simple python for the following question(s). question 11A (10 points) A square wave is a wave that transitions betweer Write the function
PYTHON. Need a simple python for the following question(s).
question 11A (10 points) A square wave is a wave that transitions betweer Write the function squarewave that draws a square The function squarewave takes two parameters: 1. t, a turtle that is used to draw the square wave. The turtle t may be in any position, 2. Length, a positive integer that is the length of one line segment The function squarewave should: wave using 5 line segments of equal length. and up/down state. draw a straight line, a fall, a straight line, a rise, and a straight line, in that order, with a 45 degree acute angle between the straight lines and the slanted lines leave t positioned at the end of the last straight line when it returns 3. 2. leave t in its initial orientation when it returns Hint: this position and orientation leave the turtle ready to draw another square wave.) For example, the following would be correct graphical output import turtle snappy turtle.Turtle() squarewave (snappy, se) Question 11B (10 points) Write a function named motif that calls squarewave to draw a specified number of square waves. The function motif takes four parameters: . a turtle, t . an integer Length, that is the length of one line segment an integer angle, the clockwise rotation between successive square waves For example, the following would be correct output an integer num, the number of square waves to draw import turtle snappyturtle.Turtle) motif (snappy, 5e, 4, 9e) nctionsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started