generated from mwc/lab_names
Added variable "r" that calculates the area
Checkpoint 1: - A value corresponds to something defined/fixed. In comparison, a name refers to something that can vary or be manipulated in some sort of way In real life, one example is SSN. Everyone has a distinct SSN (value). A person can move from their hometown (name) where they received their SSN but SSN will remain the same for all their lives. -It's helpful to use variable in programming because it allows us to use a value in different contexts/calculations. It also makes it easier for the author and the readers to understand what the numbers represent if they are named as variables. Checkpoint 2: -Function is more nested and can have different elements within, such as a value or a variable or another function. It is similar to a variable in a way that it can correspond to a certain value when executed. -Along the similar lines as the answer above, functions can help organizing our codes by chunking our calculations. I recall creating a lot of functions for my physics lab data analyses because it involved multiple dimensions of calculations with massive amounts of data. Labeling each (or a certain chunk of) calculation(s) greatly helped me keep track of my analyses.
This commit is contained in:
@@ -2,6 +2,6 @@
|
||||
# ------------
|
||||
# By MWC contributors
|
||||
|
||||
my_name ="Chris"
|
||||
my_name = input("What is your name?")
|
||||
greeting = "Hello, " + my_name
|
||||
print(greeting)
|
||||
|
||||
Reference in New Issue
Block a user