Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coding issue
#1
Hi guys! I'm new to python and coding in general. I'm trying to make a program which will register new users and login registered users. My issue is when I register a user using the program and attempt to login using the same username and password, the print says 'access denied' instead of what it should say, 'access granted'. I don't know what's the issue here. It would be great if you guys could help. Thanks! Here is the code:
a = input('Logging in or new user')
registration = []
passwords = []
if a == 'logging in':
    b = input('username')
    c = input('password')
    if b in registration:
        if c in passwords:
            print('Access granted')
        else:
            print('Access Denied')
    else:
        print('Access Denied')


if a == 'new user':
    d = input('New username')
    e = input('New password')
    f = input('confirm password')
    if e == f:
        print('Welcome ' + d)
        registration.append(d)
        passwords.append(e)
(edit: everything is properly indented)

Thank you Yoriz! I will follow these instructions next time.
Reply


Messages In This Thread
Coding issue - by 1557676 - Aug-02-2019, 06:46 PM
RE: Coding issue - by Yoriz - Aug-02-2019, 06:58 PM
RE: Coding issue - by cvsae - Aug-02-2019, 08:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Very basic coding issue aary 4 2,493 Jun-03-2020, 11:59 AM
Last Post: buran
  Very basic coding issue mstichler 3 2,610 Jun-03-2020, 04:35 AM
Last Post: mstichler
  Python Coding Issue! ankitdixit 3 95,697 Sep-25-2019, 06:31 AM
Last Post: rohanjoshi0894
  New member with simple coding issue shaikh 0 3,016 Apr-24-2017, 05:28 PM
Last Post: shaikh
  coding issue Lee 2 3,521 Feb-13-2017, 10:53 AM
Last Post: Lee

Forum Jump:

User Panel Messages

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