Initial commit

This commit is contained in:
nate 2025-05-20 00:21:12 +00:00
commit 6a14128f60
8 changed files with 122 additions and 0 deletions

26
.commit_template Normal file
View File

@ -0,0 +1,26 @@
# -----------------------------------------------------------------
# Write your entire commit message above this line.
#
# The first line should be a quick description of what you changed.
# Then leave a blank line.
# Then, taking as many lines as you want, answer the questions
# corresponding to your checkpoint.
#
# Checkpoint 1:
# - What is the difference between a value and a name? Describe
# a situation from everyday life where it's important to
# distinguish between a name and the value it refers to.
# - How might variables be useful in programming? In other
# words, why might you want to use a name rather than just
# using the value that it refers to?
#
# Checkpoint 2:
# - How is a function like a variable?
# - One of the most important problem-solving strategies in CS is
# breaking down big, hard problems into lots of small, easy problems.
# How might functions be useful in breaking down big, hard problems?
# Can you think of an example?

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
**/__pycache__/

6
circle_area.py Normal file
View File

@ -0,0 +1,6 @@
# circle_area.py
# --------------
# By MWC Contributors
print("This program will calculate the area of a circle.")
radius = float(input("What is the circle's radius? "))

32
draw_with_shapes.py Normal file
View File

@ -0,0 +1,32 @@
# draw_with_shapes.py
# -------------------
# By MWC contributors
from turtle import *
from shapes import triangle, rectangle
def flyto(x, y):
penup()
goto(x, y)
pendown()
flyto(-100, 0)
triangle(40)
triangle(60)
triangle(80)
triangle(100)
flyto(100, 0)
rectangle(10, 90)
rectangle(20, 80)
rectangle(30, 70)
rectangle(40, 60)
rectangle(50, 50)
rectangle(60, 40)
rectangle(70, 30)
rectangle(80, 20)
rectangle(90, 10)
hideturtle()
input()

7
greetings.py Normal file
View File

@ -0,0 +1,7 @@
# greetings.py
# ------------
# By MWC contributors
my_name ="Chris"
greeting = "Hello, " + my_name
print(greeting)

20
pyproject.toml Normal file
View File

@ -0,0 +1,20 @@
[project]
name = "lab-names"
version = "0.1.0"
description = ""
authors = [
{name = "Chris Proctor",email = "chris@chrisproctor.net"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.10,<4.0"
dependencies = [
]
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
package-mode = false

11
shapes.py Normal file
View File

@ -0,0 +1,11 @@
# shapes.py
# ---------
# By MWC contributors
from turtle import *
def triangle(side_length):
pass
def rectangle(height, width):
pass

19
test_shapes.py Normal file
View File

@ -0,0 +1,19 @@
# test_shapes.py
# --------------
# By MWC contributors
from turtle import *
from shapes import triangle, rectangle
def flyto(x, y):
penup()
goto(x, y)
pendown()
flyto(-100, 0)
triangle(100)
flyto(100, 0)
rectangle(20, 80)
input()