generated from mwc/lab_names
It's little bit confusing when I only use the cod
es without argumenting them for four times, but stacy told me it's because we have another programming running nested codes...that's interesting...
This commit is contained in:
parent
dc13d05c3e
commit
34d5739baf
|
@ -4,3 +4,6 @@
|
||||||
|
|
||||||
print("This program will calculate the area of a circle.")
|
print("This program will calculate the area of a circle.")
|
||||||
radius = float(input("What is the circle's radius? "))
|
radius = float(input("What is the circle's radius? "))
|
||||||
|
pi=3.141592653
|
||||||
|
circle_area=pi*radius*radius
|
||||||
|
print(circle_area)
|
||||||
|
|
18
shapes.py
18
shapes.py
|
@ -5,7 +5,21 @@
|
||||||
from turtle import *
|
from turtle import *
|
||||||
|
|
||||||
def triangle(side_length):
|
def triangle(side_length):
|
||||||
pass
|
forward(side_length)
|
||||||
|
right(120)
|
||||||
|
forward(side_length)
|
||||||
|
right(120)
|
||||||
|
forward(side_length)
|
||||||
|
right(120)
|
||||||
|
|
||||||
|
|
||||||
def rectangle(height, width):
|
def rectangle(height, width):
|
||||||
pass
|
forward (height)
|
||||||
|
right(90)
|
||||||
|
forward (width)
|
||||||
|
right (90)
|
||||||
|
forward (height)
|
||||||
|
right(90)
|
||||||
|
forward (width)
|
||||||
|
right (90)
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue