When I studied Pascal I remember that my teacher explained that to pass an argument by reference it was necessary to put var
in front of the variable in the function / procedure parameters.
Example:
function exemplo(var, a: real):real;
In Python what do I need to do to make this happen?
The idea is to have a variable defined at the beginning of the program, to change it inside the function, and to change its value outside the function without using return
.