It will need to return the distance back to the main program which you will print out. The asked function asked is given below.
A set of instructions that process input, manipulate data, and output a result is known as a program, also known as an application or software. For instance, Microsoft Word is a word processing program that enables users to create and write documents. A program is a browser, such as the one you are using to view this page.
The function is here:
import math
import turtle
import random
def randomTurtle():
for count in range(10):
choice = random.randint(1, 2)
if (choice == 1):
turtle.forward(random.randint(5, 50))
elif (choice == 2):
turtle.right(random.randint(1, 359))
def testTurtle(): turtle.forward(100)
turtle.left(90)
turtle.forward(100)
print("Distance: %.2f" % distance(turtle.xcor(), turtle.ycor()))
def distance(x, y): return math.sqrt(x * x + y * y)
# Call this when testing to make sure you have the correct answer testTurtle()
# Call this when turning it in randomTurtle()
Learn more about program
https://brainly.com/question/26134656
#SPJ4