Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do the variables work?
#3
(Apr-08-2022, 05:57 AM)Oshadha Wrote: You return the value from the function, and assign it again out of the function.
that is the better approach, pass arguments and return values.
Just FYI, what is the problem with your code using global is that you have to declare the variable global inside the function
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
How do the variables work? - by Oshadha - Apr-08-2022, 05:47 AM
RE: How do the variables work? - by Oshadha - Apr-08-2022, 05:57 AM
RE: How do the variables work? - by buran - Apr-08-2022, 06:40 AM
RE: How do the variables work? - by Oshadha - Apr-08-2022, 12:41 PM
RE: How do the variables work? - by deanhystad - Apr-08-2022, 12:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to work with variables changed in definitions Prof_Jar_Jar 2 3,296 Dec-16-2018, 12:04 AM
Last Post: Prof_Jar_Jar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020