Ad
  • Custom User Avatar

    I'm also getting confused. As I know changing a variable's value in a function doesn't affect the variable outside of the scope. For that we use the global command.

  • Custom User Avatar

    In this case is ok, since the parameters are integers and float numbers, so changing them inside the function will not change the value in the caller. If instead this was a list, a set, or other types that are passed as refrences then changing the value inside the function could cause side effects outside the function

  • Custom User Avatar

    Sure. You can modify its name.