Categories
PHP Python

Calling a function using string

PHP:
In php, you can assign a function name as a string to a variable and call the function by adding “()” after the variable name and appending a semicolon. Like this:

Python:
In python we call the function using the str as a key to the dictionary recieved by calling the globals() function. Like this:

Cool, eh?