From db6a714b5a3337f03e174a390680927db879d3ff Mon Sep 17 00:00:00 2001 From: Jeffrey Elkner Date: Wed, 28 Jun 2023 07:28:37 -0400 Subject: [PATCH] Make it nicer --- Freena/discussion2.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Freena/discussion2.py b/Freena/discussion2.py index 6621d96..c7cc6a6 100644 --- a/Freena/discussion2.py +++ b/Freena/discussion2.py @@ -1,11 +1,16 @@ -# In this example, I use def to define the function named (names_of_fruits), -# the parameter is (fruits) and the argument is 'Apple'. +# In this example, I use def to define the function named, i_love, +# the parameter is fruits and the argument is 'Apple'. -def names_of_fruits(fruit): # first line of FUNCTION DEFINITION - print("I love to eat %ss!" % fruit) # second line +def i_love(fruit): # first line of FUNCTION DEFINITION + print(f"I love to eat {fruit}s!") # second line -names_of_fruits('Apple') # FUNCTION CALL here! +i_love('Apple') # FUNCTION CALL here! # Function calls have arguments, like 'Apple' here, and function definitions -# have parameters, +# 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' +#