Question

Untitled - Notepad File Edit Format View Help #3.4.3. study the following program, and then reorganize it with a #main function that calls one or more other functions. #Your main function should be very short: create a turtle, #call your functions, and then wait for a mouse click. #Document your program with appropriate doc strings and comments. #import turtle #george turtle . Turtle() #george . setposition(0, 100) #george, pencolor(, red, ) #george. fillcolor (red ) #george . begin-fill() #george . circle(-100, 180) #george-right (90) #george. forward ( 200) #george. end-fill() #george-up ( ) #george, right (90) #george-forward ( 25 ) #george-right (90) #george. forward (50) #george, left (98) #george-down ( ) #george, pen color(white ) #george.fillcolor(,white) g #eorge . begin-fill() #george . circle(-50, 180) #george, right (98) #george. forward ( 100) #george. end-fill ( ) #screen -george.getscreen() #screen. exitonc licko!
Hi y’all this is python 3.7 I am new so please explain how code works
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the complete explanation

import turtle

#Importing the Turtle library to draw using python

george = turtle.Turtle()

#Creates an object called George of class Turtle

george.setposition(0,100)

#Sets initial position of our turtle George to x=0 and y=100

george.pencolor('red')

#Sets the line colour of our turtle to Red

george.fill('red')

#Sets the fill colour to Red

george.begin_fill()

#Begin our colour fill

george.circle(-100,100)

#Create a semicricle with radius 100 adn angle 100

george.right(90)

#Rotates george to 90 degree right

george.forward(200)

#Moves george forward 200 steps

george.end_fill()

#Finish our fill

george.up()

#Lifts the turtle up - no drawing

george.right(90)

#Rotates george to 90 degree right

george.forward(25)

#Moves george forward 25 steps

george.right(90)

#Rotates george to 90 degree right

george.forward(50)

#Moves george forward 50 steps

george.left(90)

#Rotates george to 90 degree left

george.down()

#Puts the turtledown - drawing start

george.pencolor('white')

#Sets the line colour of our turtle to White

george.fillcolor('white')

#Sets the fill colour to White

george.begin_fill()

#Begin our colour fill

george.circle(-50,180)

#Draw a semicricle with radius 50

george.right(90)

#Rotates george to 90 degree right

george.forward(100)

#Moves george forward 100 steps

george.end_fill()

#Finish our fill

screen = george.getscreen()

#Get the screen of our turtle

screen.exitonclick()

#Exit that screen when clicked

Output:

7k Python Turtle Graphics

Hope this solves the problem. Feel free to ask any queries in the comments.

Have a good day! :)

Add a comment
Know the answer?
Add Answer to:
Hi y’all this is python 3.7 I am new so please explain how code works Untitled...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need help with this code, I have it started here import sys import turtle menu...

    I need help with this code, I have it started here import sys import turtle menu = "Press 1 for Flower" UserChoice = input(menu) #function to draw squares def draw_square(square): for i in range(0,2): square.forward(100) square.right(70) square.forward(100) square.right(110) #function to draw flower def draw_flower(petalNumber): window = turtle.Screen() window.bgcolor("yellow") pen = turtle.Turtle() pen.shape("triangle") pen.color("red")    for number in range(0,petalNumber): draw_square(pen) pen.right(360/petalNumber) for i in range(0,4): pen.circle(20) pen.right(90)    pen.right(90) pen.forward(300) pen.right(90) draw_square(pen) pen.left(180) draw_square(pen) pen.left(270) pen.forward(200) window.exitonclick() #function for original art...

  • Please I need help in C language, I am trying to modify the code per the...

    Please I need help in C language, I am trying to modify the code per the below instructions, but I am getting errors. Can't fgure it out. The attempted code modification and data file is privided below, after the instructions. Thank you. Instructions:                  1.      First, add a function named printMsg that displays a message, a greeting, or an introduction to the program for the user. Add a statement that calls that function from the main function when your program starts....

  • I need help with this assignment in C++, please! *** The instructions and programming style detai...

    I need help with this assignment in C++, please! *** The instructions and programming style details are crucial for this assignment! Goal: Your assignment is to write a C+ program to read in a list of phone call records from a file, and output them in a more user-friendly format to the standard output (cout). In so doing, you will practice using the ifstream class, I'O manipulators, and the string class. File format: Here is an example of a file...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT