Computer Science, asked by puzz, 9 months ago

: What are the names of the instances in the following code? Please put one instance per blank space and enter them in the order that the computer would read them. import turtle wn = turtle.Screen() jazz = turtle.Turtle() jazz.forward(50) jazz.right(90) pop = turtle.Turtle() pop.left(180) pop.forward(76)

Answers

Answered by maniyachawla12
0

Answer:This may help you

Explanation:

There are many modules in Python that provide very powerful features that we can use in our own programs. Some of these can send email or fetch web pages. Others allow us to perform complex mathematical calculations. We have already used one module, called easygui_qt, which allowed us to use pop-up windows when asking for user input. Today, we will introduce a module that allows us to create a data object called a turtle that can be used to draw pictures. The turtle module is very similar to the Pen functionality that we explored using Scratch! Note that the turtle module is part of the standard Python installation, so you do not need to install it before using it.

Turtle graphics, as it is known, is based on a very simple metaphor. Imagine that you have a turtle that understands English. You can tell your turtle to do simple commands such as go forward and turn right. As the turtle moves around, if its tail is down touching the ground, it will draw a line (leave a trail behind) as it moves. If you tell your turtle to lift up its tail it can still move around but will not leave a trail. As you will see, you can make some pretty amazing drawings with this simple capability.

Let’s try a couple of lines of Python code to create a new turtle and start drawing a simple figure like a rectangle. We will refer to our first turtle using the variable name alex, but remember that you can choose any name you wish as long as you follow the naming rules from the previous chapter.

The program as shown will only draw the first two sides of the rectangle. After line 4 you will have a straight line going from the center of the drawing canvas towards the right. After line 6, you will have a canvas with a turtle and a half drawn rectangle. Press the run button to try it and see.

Similar questions