Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- # Declare variables
- choice = ''
- repeat = 'y'
- emailAddress = ''
- username = ''
- password = ''
- emailAddresses = [] # list to hold all email addresses
- userNames = [] # list to hold all user names
- passwords = [] # list to hold corresponding passwords
- # Display program header
- print('Login Verification Program')
- print('--------------------------')
- while repeat == 'y':
- # Display program menu
- print('\n1. Enter new login credentials')
- print('2. Display login credentials')
- print('3. Exit program')
- choice = input('Enter selection:\n')
- if choice == '1':
- # Obtain user credentials
- # emailAddress = getEmailAddress()
- # password = getPassword()
- # username = getUsername(emailAddress)
- # **************** FIX ME 4 *****************
- # Store credentials into respective lists
- # Display confirmation message
- elif choice == '2':
- # Call the displayCredentialsReport function to display all credentials
- # displayCredentialsReport(emailAddresses, passwords, userNames)
- elif choice == '3':
- # End the loop
- repeat = 'n'
- else:
- # Catchall for incorrect menu selections
- print('You have made an incorrect selection!')
- # **************** FIX ME 1 *****************
- def getEmailAddress():
- # HINT: Think about using Booleans when testing for the @ sign and period
- # if they are present in the string, then change the Boolean to True
- return emailAddress
- # **************** FIX ME 2 *****************
- def getPassword():
- # HINT: Think about using Booleans when testing each of the password conditions separately
- # if all conditions are passed, then the password is valid
- return password
- # **************** FIX ME 3 *****************
- def getUsername(emailAddress):
- # HINT: Think about using a location variable initialized to -1 used to the @ sign
- return username
- # **************** FIX ME 5 *****************
- def displayCredentialsReport(emails, passwords, usernames):
- # Display report header
- print('Login Credential Report')
- print('-----------------------\n')
- print('Email Address ' + '\t' + 'Password ' + '\t' + 'Username')
- print('------------- ' + '\t' + '-------- ' + '\t' + '--------')
- # loop through lists to display logins
- # Complete the function here
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement