Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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) nctions

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

Understand why empowerment is so important in many frontline jobs.

Answered: 1 week ago