Python Forum
variable is not defined
Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
variable is not defined
#16
It's best to return at the end of the function. That's where people expect the return to be, and if they don't see a return statement there, they may assume you don't have one (which implicitly returns None). Note that as a soon as you return a result, the function stops, and control of the program goes back to the point where the function was called. So you certainly want to wait until all the necessary processing gets done before you return a value.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
variable is not defined - by hentera - Apr-29-2017, 09:45 PM
RE: Help!!! I can't figure this out. - by hentera - Apr-29-2017, 10:23 PM
RE: variable is not defined - by sparkz_alot - Apr-29-2017, 10:51 PM
RE: variable is not defined - by hentera - Apr-29-2017, 11:08 PM
RE: variable is not defined - by metulburr - Apr-29-2017, 11:11 PM
RE: variable is not defined - by volcano63 - Apr-29-2017, 11:14 PM
RE: variable is not defined - by hentera - Apr-29-2017, 11:27 PM
RE: variable is not defined - by volcano63 - Apr-29-2017, 11:52 PM
RE: variable is not defined - by hentera - Apr-30-2017, 12:12 AM
RE: variable is not defined - by volcano63 - Apr-30-2017, 12:18 AM
RE: variable is not defined - by hentera - Apr-30-2017, 12:21 AM
RE: variable is not defined - by volcano63 - Apr-30-2017, 12:24 AM
RE: variable is not defined - by hentera - Apr-30-2017, 12:51 AM
RE: variable is not defined - by nilamo - Apr-30-2017, 01:55 AM
RE: variable is not defined - by ichabod801 - Apr-30-2017, 10:45 AM
RE: variable is not defined - by sparkz_alot - Apr-30-2017, 01:14 PM

Forum Jump:

User Panel Messages

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