-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3b.py
More file actions
executable file
·21 lines (15 loc) · 1020 Bytes
/
Copy path3b.py
File metadata and controls
executable file
·21 lines (15 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def area_of_circle(dog): # python is expecting one value(radius)
# and thus you can rename it (here 'dog'instead of r, or radius)
pi = 3.14
result = pi * dog * dog
return result
radius = 5
area = area_of_circle(radius) # argument you call in the function
# (in this ex. radius), it must have the same
# name as the variable name you want to pass into it.
# However, in the area_of_circle func
# python knows the value you pass into the first function (area_of_circle)
# is the same, and thus you can rename it (her 'dog')
# more precisely: Only the VALUE of the variable is passed to
# the function. It is then assigned to a new variable called 'dog'.
print(area)