Change your code below to create a pattern using nested loops. Your initial needs to appear at least eight times in the pattern and pattern doesn't matter.
import turtle
# Setting background color
screen = turtle.Screen()
screen.bgcolor("skyblue")
#drawing letter 'M' in color dark blue
turtle.penup()
turtle.pensize(9)
turtle.color("dark blue")
turtle.goto(-300,200)
turtle.pendown()
turtle.right(90)
turtle.forward(300)
turtle.backward(300)
turtle.left(45)
turtle.forward(200)
turtle.left(90)
turtle.forward(200)
turtle.right(135)
turtle.forward(300)
turtle.backward(300)
# adding space between M and P
turtle.left(90)
turtle.penup()
turtle.forward(100)
turtle.pendown()
#drawing letter 'P' in color green
turtle.pensize(8)
turtle.color("green")
turtle.right(90)
turtle.forward(300)
turtle.backward(150)
turtle.left(90)
turtle.circle(75,extent=180)
turtle.done
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- 1. In each iteration of a loop, generate a random number, and use it to determine some attribute of what is drawn in that iteration. For example, draw one shape multiple times in random locations and/or at random sizes OR 2. write a triply nested for loop to add even more complexity to your drawing than with a doubly nested looparrow_forwardPython code Upload a picture of your code(please don’t type it in here).arrow_forwardThe progam below was created by your experts and suppose create a pattern using nested loops. Your initial needs to appear at least eight times in the pattern and pattern doesn't matter. and it was good created but i received comment saying: - this is not using nested loops. Can someone please fix it the code below by using NESTED LOOPS? import turtle # Setting background color screen = turtle.Screen()screen.bgcolor("skyblue") #drawing letter 'M' in different colors turtle.penup()turtle.pensize(9) turtle.goto(-300,50)turtle.right(90)turtle.forward(300) for i in range (1,4):turtle.color("dark blue")turtle.pendown()turtle.backward(60)turtle.left(45)turtle.forward(40)turtle.left(90)turtle.forward(40)turtle.right(135)turtle.forward(60)turtle.backward(60) for i in range (1,4):turtle.color("red")turtle.pendown()turtle.backward(60)turtle.left(45)turtle.forward(40)turtle.left(90)turtle.forward(40)turtle.right(135)turtle.forward(60)turtle.backward(60) for i in range…arrow_forward
- Please add an gif image/plot an gif to this code. This is a brownian motion python code here it is code import numpy as np import matplotlib.pyplot as plt def brownian_motion(L, N): # initialize position in the center of the grid x = L // 2 y = L // 2 # initialize the grid grid = np.zeros((L, L), dtype=np.int32) # loop over the number of steps for i in range(N): # choose a random direction direction = np.random.choice(['up', 'down', 'left', 'right']) # move one step in that direction if direction == 'up': " y += 1" elif direction == 'down': "y -= 1" elif direction == 'left': "x -= 1" elif direction == 'right': "x += 1" # make sure the particle is still on the grid if x < 0 or x >= L or y < 0 or y >= L: "continue" # update the grid grid[y, x] = 1 return grid if __name__ == '__main__': # set the size of the grid L…arrow_forwardConnectedCircles.java, allows the userto create circles and determine whether they are connected. Rewrite the programfor rectangles. The program lets the user create a rectangle by clicking amouse in a blank area that is not currently covered by a rectangle. As the rectanglesare added, the rectangles are repainted as filled if they are connected orare unfilled otherwise, as shown in Figure b–c.arrow_forwardYou have square tiles with a side length of ⅓ inch Draw a 4 x 5 array using the square tiles. What are the dimensions of the rectangular array?arrow_forward
- x = zeros(uint8(5,5)); for i = 1:5 for j = 1:5 a = 5/i; x(i,j) = 255/a; end end Which of the following best describes the black and white image x? 1. The columns of x will get lighter from left to right 2. The rows of x will get lighter from top to bottom 3. The rows of x will get darker from top to bottom 4. The columns of x will get darker from left to rightarrow_forwardWrite a code to the following image using Console.WriteLine.arrow_forward27. Continue the source code below to complete the house shape! import turtle t - turtle. Turtle () t.fd (227) t.lt (90) t.fd(100) t.rt (90) t.fd(50) t.lt (145) t.fd (200) #complete the source code Python Turtie Graphics AL.lt (70) t.fa(100) t.rt (90) t.fa (50) t.rt (145) t.fd (200) t.lt (145) t.fd(200) t.lt (90) t.fd(100) B t.rt (90) t. fd(100) xC t.lt (70) t. fd (200) t.lt (145) t. fd (50) t.rt (90) t. fa (100) t.lt (145) t. fd (50) t.lt (90) t. fd(100) t.rt (90) t.fd(100) Darrow_forward
- 8. This Old House (For Python) Use the Canvas widget that you learned in this chapter to draw a house. Be sure to include at least two windows and a door. Feel free to draw other objects as well, such as the sky, sun, and even clouds.arrow_forward2. Write code that uses turtle graphics to draw four concentric circles ofradius 50, 100, 150 and 200.arrow_forwardFor this code please add these features making it be able to : #generate a blank image with black background, picture size is the same as frame #allow it to calculate center point #Draw white circles into the image generated at line 6, diameter is 6arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY