Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

2. Write a program to draw this. Assume the innermost square is 20 units per side, and each successive square is 20 units bigger, per side, than the one inside it.

import turtle
wn = turtle.Screen()
wn.bgcolor("lightgreen")
tess = turtle.Turtle()

def draw_square(t,size):
    for i in range(4):
        tess.forward(size)
        tess.left(90)

size = 20
for j in range(3):
   tess.pensize(3)
   draw_square(tess,size)
   size = size + 20
   tess.penup()
   tess.goto(-20, -20)
   tess.pendown()

wn.mainloop()
Comment

PREVIOUS NEXT
Code Example
Typescript :: adoni migrate 
Typescript :: how to find specific elements from a list in java 
Typescript :: flutter web keep focus on textfield 
Typescript :: class-validator not working nest-typescript-starter 
Typescript :: error TS2531 
Typescript :: sails.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies 
Typescript :: typoescript find multiple items in array and return found 
Typescript :: java check if element exists in array 
Typescript :: typescript class extends 
Typescript :: java 8 collect multiple lists into single list 
Typescript :: add custom function to google sheets 
Typescript :: outputs i angular 
Typescript :: how to make objects move in roblox studio with a loop 
Typescript :: typescript run on save 
Typescript :: how to search for elements that are on the webpage using html 
Typescript :: how to add custom snippets in emmet in visual studio code 
Typescript :: Interface with custom property name types 
Typescript :: flutter constructor default value 
Typescript :: disadvantages of automation 
Typescript :: angular material chips autocomplete example 
Typescript :: typescript require not defined 
Typescript :: typescript react switch case component 
Typescript :: ts foreach property ts 
Typescript :: serenity-is change button text 
Typescript :: The velocity of light in vacuum is 
Typescript :: how to show account related contacts on click of a button using lightnig components 
Typescript :: typescript split/partition array by condition 
Typescript :: More than one custom value accessor matches form control with unspecified name attribute 
Typescript :: terrform variable list type 
Typescript :: which network device reads the source and destination MAC addresses, looks up the destination to determine where to send the frame, and forwards it out to the correct port 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =