Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
variable gets lost
#10
Going back to your original post, in addition to what ichabod801 pointed out, lines 10 and 11 are not indented properly. Also, in line five you are iterating through the list 'admin' and can be simplified to

def login(name):
    if name in admin:
        print("Welcome in the system " + name)
        logged_in = 1
    else:
        print('you are not an admin')
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
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,161 Jul-18-2023, 06:04 PM
Last Post: jrockow
  Lost Modules standenman 2 778 Jun-22-2023, 12:18 PM
Last Post: standenman
  Lost Module standenman 10 2,964 Oct-30-2021, 05:11 PM
Last Post: deanhystad
  XML Editing formatting lost ateestructural 2 1,950 Apr-08-2021, 04:41 AM
Last Post: ndc85430
  List structure lost when multiplying Protonn 2 2,302 Apr-23-2020, 04:16 AM
Last Post: buran
  lost dictionary jjpy 1 1,927 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