I change my_name = input("what is your name?").

I added import math, area = math.pi * (radius * radius) and print(area).

Checkpoint 1: Value is anything that is what it is instead of referring to something else. Name is referred to something else. A name could change or be different depending on different contexts. A name can be refer to you but you can change your name or you may have different variations of your name. Variables are a name that refers to a value. Assign a value to a variable. Variables are very useful in programming as we can assign the value on the right to the name on the left (name = value). If we want to change the value of the name we can easily go back and change it which is helpful in programming. You also can use the name/variable name instead of the value. For example for the value of pi rather than typing that value out you can assign the value to the name and use the name throughout the whole programming code.
This commit is contained in:
erbrown
2025-09-08 11:26:09 -04:00
parent 2c3b6e6b54
commit cb8e7b84ed
2 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
# circle_area.py # circle_area.py
# -------------- # --------------
# By MWC Contributors # By MWC Contributors
import math
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? "))
area = math.pi * (radius * radius)
print(area)

View File

@@ -2,6 +2,6 @@
# ------------ # ------------
# By MWC contributors # By MWC contributors
my_name ="Chris" my_name = input("What is your name? ")
greeting = "Hello, " + my_name greeting = "Hello, " + my_name
print(greeting) print(greeting)