generated from mwc/lab_names
resubmitting it didn't work properly the 1st time
This commit is contained in:
parent
54019709a1
commit
8447179a44
|
@ -4,3 +4,6 @@
|
|||
|
||||
print("This program will calculate the area of a circle.")
|
||||
radius = float(input("What is the circle's radius? "))
|
||||
pi=3.141592653
|
||||
area=pi*radius*radius
|
||||
print (area)
|
|
@ -0,0 +1,7 @@
|
|||
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
|
||||
package = []
|
||||
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.10"
|
||||
content-hash = "53f2eabc9c26446fbcc00d348c47878e118afc2054778c3c803a0a8028af27d9"
|
23
shapes.py
23
shapes.py
|
@ -3,9 +3,24 @@
|
|||
# By MWC contributors
|
||||
|
||||
from turtle import *
|
||||
|
||||
|
||||
def triangle(side_length):
|
||||
pass
|
||||
forward(side_length)
|
||||
right(120)
|
||||
forward(side_length)
|
||||
right(120)
|
||||
forward(side_length)
|
||||
right(120)
|
||||
|
||||
def rectangle(width,height):
|
||||
forward(width)
|
||||
right(90)
|
||||
forward(height)
|
||||
right(90)
|
||||
forward(width)
|
||||
right(90)
|
||||
forward(height)
|
||||
right(90)
|
||||
|
||||
|
||||
|
||||
def rectangle(height, width):
|
||||
pass
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
from turtle import *
|
||||
|
||||
def square(side_length):
|
||||
for _ in range(4):
|
||||
forward(side_length)
|
||||
right (45)
|
||||
|
||||
|
||||
color ('red')
|
||||
pensize (10)
|
||||
speed (9)
|
||||
|
||||
sizes = [20, 40, 60, 80, 100]
|
||||
for size in sizes:
|
||||
square(size)
|
||||
penup()
|
||||
right(90)
|
||||
forward(20)
|
||||
left(90)
|
||||
pendown()
|
||||
square(size)
|
||||
penup()
|
||||
right(90)
|
||||
forward(20)
|
||||
left(90)
|
||||
pendown()
|
||||
square(size)
|
||||
penup()
|
||||
right(90)
|
||||
forward(20)
|
||||
left(90)
|
||||
pendown()
|
||||
square(size)
|
||||
penup()
|
||||
right(90)
|
||||
forward(20)
|
||||
left(90)
|
||||
pendown()
|
||||
square(size)
|
||||
penup()
|
||||
right(90)
|
||||
forward(20)
|
||||
left(90)
|
||||
pendown()
|
||||
|
||||
from turtle import *
|
||||
|
||||
|
||||
def rectangle(width, height):
|
||||
|
||||
for _ in range(2):
|
||||
forward(width)
|
||||
right(90)
|
||||
forward(height)
|
||||
right(90)
|
||||
|
||||
|
||||
penup()
|
||||
color('green')
|
||||
pensize(10)
|
||||
speed(3)
|
||||
|
||||
|
||||
|
||||
left(90)
|
||||
pendown()
|
||||
rectangle(width = 100, height=100)
|
||||
penup()
|
||||
forward(90)
|
||||
pendown()
|
||||
rectangle(width=100, height=100)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue