From f0f2557b0016d7ce3a35ab3499347e176e58abe9 Mon Sep 17 00:00:00 2001 From: jwberent Date: Fri, 5 Sep 2025 14:34:08 -0400 Subject: [PATCH] I changed the greeting to allow the user to say their name. It will then greet them by their name. I also allowed the code to find the area of a circle when the user gives the radius. Checkpoint 1: The difference between a value and a name is that a value is the thing that it is and a name refers to seomthing else. Values can be floats, ints, strings, or booleans. In real life you would call someone by their name, not by describing them so you would call someone by their name, not value. Variables are important in coding because they allow you to not have to repeat lines of code over and over again. Once you make a variable you can call it multiple times and it will remember the code associated with it. --- circle_area.py | 3 +++ greetings.py | 2 +- poetry.lock | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 poetry.lock diff --git a/circle_area.py b/circle_area.py index 513d6f7..c289803 100644 --- a/circle_area.py +++ b/circle_area.py @@ -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**2 +print(area) diff --git a/greetings.py b/greetings.py index 2d878a6..c19f6c3 100644 --- a/greetings.py +++ b/greetings.py @@ -2,6 +2,6 @@ # ------------ # By MWC contributors -my_name ="Chris" +my_name =input("What is your name? ") greeting = "Hello, " + my_name print(greeting) diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..7e72dc6 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand. +package = [] + +[metadata] +lock-version = "2.1" +python-versions = ">=3.10,<4.0" +content-hash = "7b8fc01b274bd807fb00372bbc8e138330f15ae7978ed61e180f3b17ec076725"