DEV Community

Discussion on: Introduction To Modern Python

Collapse
 
morphzg profile image
MorphZG • Edited

Just small correction. Function name does not not make a call. Instead it is just the reference. You make the call by adding parenthensis.

Try to create the list of functions and than call the function at position 1. List will contain only names. It will look like this:

list = [function1, function2, function3]
list[1]()
Enter fullscreen mode Exit fullscreen mode
Collapse
 
muriithigakuru profile image
Muriithi Gakuru

Thank you for pointing that out. Indeed the function would'nt be called. Without the brackets we'll just get where the function is stored in memory but won't access the result.