0
Intro to Functional Programming
I am currently doing the first lesson. I am a little lost with tihs. The lesson states that "Functions can take other functions as arugments" https://sololearn.com/compiler-playground/czBfIYvSWV0o/?ref=app The code above is the lesson example and it runs smooth but I'm confused on this. I've learned that arguments go inside of parethesis (correct me if I'm wrong). Is so, wouldn't the welcome function be put into: def process_user(welcome, name, func) instead? This is where I'm confused. I expect the welcome function to be an arugment and it's not. I hope this makes sense and can someone explain to help me understand better
6 Antworten
+ 2
"welcome" is the function.
print(process_user(name="Alice", func=welcome))
+ 2
Nicole Krason ,
Sololearn has a good topic list, but you have to consult python.org to flesh out some of the details.
+ 1
@lisa okay
+ 1
Nicole Krason ,
Some things Sololearn doesn't fully explain:
Arguments go inside the parentheses of a function call.
Parameters go inside the parentheses of a function definition.
When you call a function, the arguments are assigned to the parameters.
+ 1
Rain okay, that makes sense! Thank you!
Yeah, I'm not 100% happy with SoloLearn to be honest
+ 1
Rain i need to create that habit for myself