Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
variable gets lost
#2
I'm not getting that error, at least not in Python 3.5. Note, however, that variables have scope. The logged_in variable in your login function only works within that function, it doesn't modify the logged_in variable on line 2. It's the difference between function scope and module scope. I would suggest using return values to modify the outer logged in variable.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
variable gets lost - by Jordy - Oct-10-2016, 05:47 PM
RE: variable gets lost - by ichabod801 - Oct-10-2016, 06:03 PM
RE: variable gets lost - by Jordy - Oct-10-2016, 07:15 PM
RE: variable gets lost - by ichabod801 - Oct-10-2016, 07:32 PM
RE: variable gets lost - by Jordy - Oct-10-2016, 07:34 PM
RE: variable gets lost - by ichabod801 - Oct-10-2016, 07:36 PM
RE: variable gets lost - by Jordy - Oct-10-2016, 07:42 PM
RE: variable gets lost - by sparkz_alot - Oct-10-2016, 07:51 PM
RE: variable gets lost - by Mekire - Oct-10-2016, 07:56 PM
RE: variable gets lost - by sparkz_alot - Oct-10-2016, 08:06 PM
RE: variable gets lost - by Yoriz - Oct-10-2016, 08:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Lost Control over VLC jrockow 8 1,168 Jul-18-2023, 06:04 PM
Last Post: jrockow
  Lost Modules standenman 2 780 Jun-22-2023, 12:18 PM
Last Post: standenman
  Lost Module standenman 10 2,975 Oct-30-2021, 05:11 PM
Last Post: deanhystad
  XML Editing formatting lost ateestructural 2 1,957 Apr-08-2021, 04:41 AM
Last Post: ndc85430
  List structure lost when multiplying Protonn 2 2,307 Apr-23-2020, 04:16 AM
Last Post: buran
  lost dictionary jjpy 1 1,931 Jul-10-2019, 12:19 PM
Last Post: scidam

Forum Jump:

User Panel Messages

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