I'm starting programming on Python and I'm having a very hard time understanding some concepts. If the user selects option 3, the program has to show the results of two lists. The problem is that after the login is successful, the lists are not displayed. If someone could help me I would be very grateful.
list_login = []
list_password = []
list_employees = ['Pedro' , 'Ana', 'Carlos', 'Maria Clara', 'João Antônio']
list_salaries = [3470.00, 2200.00, 3970.34, 7450.23, 5677.33]
def check(login_user):
if login_user in list_login:
return True
else:
return False
def authentication(index,user_password):
if list_password[index] == user_password:
print('User authenticated!')
return True
else:
print('Incorrect Password!')
return False
def login():
login_user = input('Type your login: ')
user_password = input('Type your password: ')
if check(login_user):
index = list_login.index(login_user)
authentication(index,user_password)
else:
print("Login information is incorrect or does not exist.")
def new_login():
name = input('Type your name: ')
if name not in list_employees:
print('Name is not in the emplyee list, type again!')
if name in list_employee:
login_user = input('Type the login you wish to register: ')
if login_user not in list_login:
print('Login is available!')
if login_user in list_login:
print('There is already a user registered with this login')
else:
password_user = input('Type the password that will be registered: ')
list_login.append(login_user)
list_password.append(password_user)
print('User registered!')
print('Employee name: ', name)
print('Login saved: ', login_user)
print('Password saved: ', password_user)
def create_employee():
name = input('Type the name of the new employee: ')
salary = float(input('Type the employee's salary: '))
list_employees.append(name)
list_salaries.append(salary)
print('Employee ',name,' registered with the current salary of: ',salary)
while True:
choice = input(
'''
MENU
1- Create Login and Password
2- Increase salary 10%
3- Report
4- Create New Employee
Choose a option: '''
)
if choice == '1':
new_login()
if choice == '2':
login()
**if choice == '3':
if login():
for i in range(len(list_employees)):
print((list_employees[i]),' - ',(list_salaries[i]))**
if choice == '4':
create_employee()