What is the difference between these two? (Assigning functions to variables)
Max Nathaniel Ho
maxhowl86 at gmail.com
Wed Nov 5 04:15:30 CET 2014
return "Hello there!"
greet = compose_greet_func()
return "hello "+name
greet_someone = greet
In Example 1, the function compoe_greet_func is assigned to the variable greet, and () is included at the end of the function.
However, in Example 2, the function greet is assigned to the variable greet_someone but () is excluded at the end of the function.
Does the () matter when assigning functions to variables?
More information about the Python-list