You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PythonStudy/Freena/discussion2.py

17 lines
614 B
Python

2 years ago
# In this example, I use def to define the function named, i_love,
# the parameter is fruits and the argument is 'Apple'.
2 years ago
def i_love(fruit): # first line of FUNCTION DEFINITION
print(f"I love to eat {fruit}s!") # second line
2 years ago
i_love('Apple') # FUNCTION CALL here!
# Function calls have arguments, like 'Apple' here, and function definitions
2 years ago
# have parameters. The parameter here is fruit. The argument is a *value*,
# and the parameter is a *name*. Values are mapped to names, just like with
# an assignment statement. It's the same as:
#
# fruit = 'Apple'
#