Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help I Need help. Its python. only send work in a screen shot please. Please help I Need help. Its python. only send work

Please help I Need help. Its python. only send work in a screen shot please.

image text in transcribedimage text in transcribed

Please help I Need help. Its python. only send work in a screen shot please.

The code that is stating in the directions is the code below it.

Directions Directions Modify the program in the following ways: 1. Write appropriate comments for this program and function. Include: . A header comment for the program A header for the function describing the parameters and return value. Comment the blocks of code. The text has descriptions of all this, so reread that if necessary. 2. Following the process in the previous unit's assignment, write a function to randomly move a turtle. The function should have at least one parameter, the turtle to move. Call this function in your main program instead of the code that is already there. If you do this correctly, your program will behave the same. 3. Create a second turtle, make it a different color, and start it at a different location than the current one. The location should be 100 units away, either horizontally or vertically. 4. The second turtle should move randomly 5 times for every time the first turtle does. It should also move 1/5 the distance as the original turtle each time. This is where having a function with proper parameters comes in handy. 5. After the loop, write a message, in the center of the window, indicating which turtle was higher up. Use the turtle that is higher (more toward the top of the screen) to do the writing. Be sure your message specifies the turtle. See the write() function in the turtle module for writing text messages in the window. 6. Once your program works the way you want, rewrite the if statement in the function isInScreen, so it still implements the same logic, but does it a different way. For example, maybe you can use an elit, maybe you can write several statements and eliminate the use of or. You should probably do this step last, or else if you make a mistake, you'll never be able to debug the rest of your code. can run the program before you do anything else. import random import turtle = def isInScreen (win, turt): leftBound -win.window width() / 2 rightBound = win.window width() / 2 topBound = win.window_height() / 2 bottomBound = -win.window_height() / 2 turtleX = turt.xcor () turtleY = turt.ycor() stillIn = True if turtleX > rightBound or turtleX topBound or turtley rightBound or turtleX topBound or turtley

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions