Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use python and comment code functions. Thank you! For each of the four following problems, write a function that solves the problem. Demo each

Please use python and comment code functions. Thank you! image text in transcribed
image text in transcribed
image text in transcribed
For each of the four following problems, write a function that solves the problem. Demo each function you write by calling it in a function called main. I suggest creating your turtle in main and passing it to the function, like so! import turtle def myFunction (myTurtle): # tell my turtle to do something print "I should replace this line...") def main) bob turtle . Turtle () myFunction (bob) turtle.done() #last line of main main() 1 Turtle Olympics Write a function which uses a turtle to draw the Olympic ring logo. Extra credit if you can get the rings to overlap and cross over and under correctly 2 Turtle Clock Draw the face of analog clock using a turtle. It should resemble the following picture, but you can be creative! Remember the stamp) function a turtle can use, as well as penup) Figure 1: A clock of turtles. 3 Initials Write a function that draws your initials. 4 Draw Shape Write a function that takes in both a turtle and number n. Your turtle should then draw an n-sided regular polygon, i.e. a shape with n sides that all are the same size and all the angles are the same angle. In other words, if n is 3, thern your turtle will draw an equilateral triangle. If n is 4, your turtle should draw a square. My hint is that all the angles in the shape w add up to 360 degrees. For each of the four following problems, write a function that solves the problem. Demo each function you write by calling it in a function called main. I suggest creating your turtle in main and passing it to the function, like so! import turtle def myFunction (myTurtle): # tell my turtle to do something print "I should replace this line...") def main) bob turtle . Turtle () myFunction (bob) turtle.done() #last line of main main() 1 Turtle Olympics Write a function which uses a turtle to draw the Olympic ring logo. Extra credit if you can get the rings to overlap and cross over and under correctly 2 Turtle Clock Draw the face of analog clock using a turtle. It should resemble the following picture, but you can be creative! Remember the stamp) function a turtle can use, as well as penup) Figure 1: A clock of turtles. 3 Initials Write a function that draws your initials. 4 Draw Shape Write a function that takes in both a turtle and number n. Your turtle should then draw an n-sided regular polygon, i.e. a shape with n sides that all are the same size and all the angles are the same angle. In other words, if n is 3, thern your turtle will draw an equilateral triangle. If n is 4, your turtle should draw a square. My hint is that all the angles in the shape w add up to 360 degrees

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

Will we see any changes in 2020 for itemized deductions for taxes ?

Answered: 1 week ago