Write a program called draw_shapes.py.
In your program,
Save and run your program.
It should look like this:
Upload only your draw_shapes.py to this assignment. A screenshot is not necessary.
After instruction number 3 IDK what to type. After that, I get confused about what order should I put code in and I'm new using Py. Please help me out with this difficult Homework. thanks in advance.
draw_shapes.py """ Your Name: First Name Last Name Date: YYYY-MM-DD This program creates a turtle window of size 400 * 400 It draws a hexagon of side length 40 and octagon of side length 30 and a triangle of side length 70 """ # import turtle module and set the screen size as 400 * 400 and fill background color as indigo import turtle win = turtle.Screen() win.screensize(400, 400) win.bgcolor('#4b0082') win.title('Shapes') tom = turtle.Turtle() # the below code is to draw hexagon # for loop iterates through 0-5 and it is filled with yellow color tom.penup() tom.goto(80, 80) tom.pendown() tom.fillcolor('yellow') tom.begin_fill() for i in range(6): # it moves 40 pixels to forward and makes an angle of 60 degrees to its right tom.forward(40) tom.right(60) tom.end_fill() # the below code is to draw octagon # for loop iterates through 0-7 and it is filled with red color tom.penup() tom.goto(-20, 20) tom.pendown() tom.fillcolor('red') tom.begin_fill() for i in range(8): # it moves 30 pixels to forward and makes an angle of 45 degrees to its right tom.forward(30) tom.right(45) tom.end_fill() # the below code is to draw triangle # for loop iterates through 0-2 and it is filled with pink color tom.penup() tom.goto(80, -120) tom.pendown() tom.right(60) tom.fillcolor('pink') tom.begin_fill() for i in range(3): # it moves 70 pixels to forward and makes an angle of 120 degrees to its right tom.forward(70) tom.right(120) tom.end_fill() win.exitonclick()
Write a program called draw_shapes.py. In your program, Create a block header with: your name the...
Python Question Task 4 Create a function named poker_table that uses Turtle Graphics to create a single poker table to accommodate all players. There should be four parameters: num_players indicates the number of players; side_length indicates the length in pixels of each side of the table; and x and y, which give the location where you should start drawing the table. The poker table should be a simple regular polygon (that is, with sides of equal length). The number of...
Turtle Graphics with nested loop: Write a turtle graphics python program repeat_squares.py that uses nested loops to draw 100 squares, to create this design: Turtle-squares.png starting with the smallest square in the bottom right-hand corner. Start at position (-4,4). At each step increase the length of each side by 4 pixels. Draw 100 squares. Please submit with an animation speed of 0 and the turtle hidden turtle.hideturtle()
Java Turtles Drawing A Regular Polygon Write the code to have the turtle draw a regular polygon with the specified number of sides and specified side length. Draw the Specified number of regular polygons, each starting at the same place, however, after each polygon is drawn the turtle turns 360 / numpolys degrees
Writing the code in IDLE. Make sure the code is working. thank you so much Create the following turtle pattern. Using the turtle and random modules, write a program that creates an output as the one shown in the picture below. Consider the following: . Change the color of the window to "red" using wn.bgcolor property of the screen variable you create. . Your turtle variable has to have a pen color "white", you have to use the .pencolor property...
Write a class named Octagon (Octagon.java) that extends the following abstract GeometricObject class and implements the Comparable and Cloneable interfaces. //GeometricObject.java: The abstract GeometricObject class public abstract class GeometricObject { private String color = "white"; private boolean filled; private java.util.Date dateCreated; /** Construct a default geometric object */ protected GeometricObject() { dateCreated = new java.util.Date(); } /** Construct a geometric object with color and filled value */ protected GeometricObject(String color, boolean filled) { dateCreated = new java.util.Date(); this.color = color;...
GUI bouncing shapes program use this interface the out put of the program should be a jFrame with three buttons: “add triangle”, “add square” and “add circle” and a blank screen. when the user clicks any of these buttons the corresponding shape appears and starts bouncing around the screen. the shape of these shaoes and randomized and anytime the user clicks the button you should be able to keeping adding shapes on the screen while the previosus shape is bouncing...
create anything in python. Make sure your code covers all of the following things: • Use the concepts of object-based programming—classes, objects, and methods • Draw two-dimensional shape • Use the RGB system to create colors in graphics applications and modify pixels in images • Develop recursive algorithms to draw recursive shapes • Write a nested loop to process a two-dimensional grid • Perform simple transformations of images, such as conversion of color to gray-scale
For this lab you will write a small program that prints a few "shapes" using asterisks. Your program will prompt the user to select a shape by entering a number (square or triangle for B grade, add the zig- zag for the A grade). It will then prompt for the size, and then if a square or triangle is selected it will prompt for "not filled" or "filled", and if azig-zag is selected it will prompt for the number of...
Use Python 3 Create a program that uses Turtle to draw shapes. Show the following menu: Enter Circle Enter Rectangle Remove Shape Draw Shapes Exit Circles – User inputs position, radius, and color. The position is the CENTER of the circle Rectangles – User inputs position, height, width, color. The position is the lower left-hand corner Colors – Allow red, yellow, blue, and green only Remove – Show the number of items in the list and let the user enter...
How to write this code in python? Linear Interpolation Write a program that will create a linear interpolation between two pixels. You are to read in two pixel values and generate a number of pixels specified between them. Input for the program 1 Enter the first pixel value: 0x002222 2 Enter the second pixel values: OxFFDD3:3 3 Enter the number of pixels to generate inbetween: 3 Using the 2 pixels specified it will generate 3 new pixels between the first...