Advertisement
Guest User

Untitled

a guest
Mar 1st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. def main():
  2.  
  3. # Declare variables
  4. choice = ''
  5. repeat = 'y'
  6. emailAddress = ''
  7. username = ''
  8. password = ''
  9. emailAddresses = [] # list to hold all email addresses
  10. userNames = [] # list to hold all user names
  11. passwords = [] # list to hold corresponding passwords
  12.  
  13. # Display program header
  14. print('Login Verification Program')
  15. print('--------------------------')
  16.  
  17. while repeat == 'y':
  18.  
  19. # Display program menu
  20. print('\n1. Enter new login credentials')
  21. print('2. Display login credentials')
  22. print('3. Exit program')
  23. choice = input('Enter selection:\n')
  24.  
  25. if choice == '1':
  26. # Obtain user credentials
  27. # emailAddress = getEmailAddress()
  28. # password = getPassword()
  29. # username = getUsername(emailAddress)
  30.  
  31. # **************** FIX ME 4 *****************
  32. # Store credentials into respective lists
  33.  
  34. # Display confirmation message
  35.  
  36. elif choice == '2':
  37. # Call the displayCredentialsReport function to display all credentials
  38. # displayCredentialsReport(emailAddresses, passwords, userNames)
  39.  
  40. elif choice == '3':
  41. # End the loop
  42. repeat = 'n'
  43. else:
  44. # Catchall for incorrect menu selections
  45. print('You have made an incorrect selection!')
  46.  
  47. # **************** FIX ME 1 *****************
  48. def getEmailAddress():
  49. # HINT: Think about using Booleans when testing for the @ sign and period
  50. # if they are present in the string, then change the Boolean to True
  51. return emailAddress
  52.  
  53. # **************** FIX ME 2 *****************
  54. def getPassword():
  55. # HINT: Think about using Booleans when testing each of the password conditions separately
  56. # if all conditions are passed, then the password is valid
  57. return password
  58.  
  59. # **************** FIX ME 3 *****************
  60. def getUsername(emailAddress):
  61. # HINT: Think about using a location variable initialized to -1 used to the @ sign
  62. return username
  63.  
  64. # **************** FIX ME 5 *****************
  65. def displayCredentialsReport(emails, passwords, usernames):
  66.  
  67. # Display report header
  68. print('Login Credential Report')
  69. print('-----------------------\n')
  70.  
  71. print('Email Address ' + '\t' + 'Password ' + '\t' + 'Username')
  72. print('------------- ' + '\t' + '-------- ' + '\t' + '--------')
  73.  
  74. # loop through lists to display logins
  75. # Complete the function here
  76.  
  77. if __name__ == '__main__':
  78. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement