Skip to content
Advertisement

python: can i set a variable to equal a function of itself?

Can I do this?

JavaScript

When I tried to do this I got errors, but perhaps I was doing something wrong.

Advertisement

Answer

If the variable has been previously defined, you can do that yes.

Example:

JavaScript

If the variable has not been defined previously, you can’t do that, simply because there is no value that could be passed to the function.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement