Top "Function" questions

A function (also called a procedure, method, subroutine, or routine) is a portion of code intended to carry out a single, specific task.

Python 3: UnboundLocalError: local variable referenced before assignment

The following code gives the error UnboundLocalError: local variable 'Var1' referenced before assignment: Var1 = 1 Var2 = 0 def function(): if Var2 == 0 …

python function python-3.x
Run function from the command line

I have this code: def hello(): return 'Hi :)' How would I run this directly from the command line?

python function command-line
What is a "static" function in C?

The question was about plain c functions, not c++ static methods, as clarified in comments. I understand what a static …

c function static terminology
How do you pass a function as a parameter in C?

I want to create a function that performs a function passed by parameter on a set of data. How do …

c function pointers syntax parameters
How to create a jQuery function (a new jQuery method or plugin)?

I know that in JavaScript the syntax is as follows: function myfunction(param){ //some code } Is there a way to …

javascript jquery function
TypeError: $ is not a function when calling jQuery function

I have a simple jQuery script in a WordPress plugin that is using a jQuery wrapper like this: $(document).ready(…

jquery wordpress function wrapper typeerror
Why are Python lambdas useful?

I'm trying to figure out Python lambdas. Is lambda one of those "interesting" language items that in real life should …

python function lambda closures
Deprecated: mysql_connect()

I am getting this warning, but the program still runs correctly. The MySQL code is showing me a message in …

php mysql function deprecated
Cannot read property 'addEventListener' of null

I have to use vanilla JavaScript for a project. I have a few functions, one of which is a button …

javascript function getelementbyid addeventlistener
How to get a function name as a string?

In Python, how do I get a function name as a string, without calling the function? def my_function(): pass …

python string function