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

1 year ago
# In this example, I use def to define the function named, i_love,
# the parameter is fruits and the argument is 'Apple'.
1 year ago
def i_love(fruit): # first line of FUNCTION DEFINITION
print(f"I love to eat {fruit}s!") # second line
1 year ago
i_love('Apple') # FUNCTION CALL here!
# Function calls have arguments, like 'Apple' here, and function definitions
1 year 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'
#