Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

Python program to determine whether a password meets all the requirements for a secure password

Computer Science Feb 24, 2021

Python program to determine whether a password meets all the requirements for a secure password. Your program should prompt the user for the candidate password and output either that the password is valid or the reason it is invalid. To be valid the length of the password must greater than some minimum length but less than some maximum. It must not include the substring "umgc" in any combination of upper or lower case letters. Finally, it must contain the # symbol is some position other than the first or last character. You should decide on the minimum and maximum allowable lengths.

Your program should include the pseudocode used for your design in the comments. Document the values you chose for the minimum and maximum allowable lengths in your comments as well.

 

Expert Solution

Answer:

#Take input from user

password = input("Enter the password: ")

 

#Find the length of the password

length_password = len(password)

 

#Initialize the max and min length of password

max_length = 10

min_length = 8

 

#Check if the length of password is within the min and max values 

if len(password) >= min_length and len(password) <= max_length:

 

  #Check if the sub-string "umgc" is present in the password

  if password.lower().find("umgc") == -1:

 

    #Check if the password have "#" in it and not at position first and last

    if "#" in password and password[0] != '#' and password[-1]!='#':

      #If all conditions true print the success statement.

      print("You have entered a valid password!")

    else:

      #Error if # is not used or used at illegal places

      print("Invalid password!")

  else:

    #Error if the password has the string "umgc"

    print("Invalid password!")

else:

  #Error if the length of string is not within specified ranges.

  print("Invalid password!")

Archived Solution
Unlocked Solution

You have full access to this solution. To save a copy with all formatting and attachments, use the button below.

Already a member? Sign In
Important Note: This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.

For ready-to-submit work, please order a fresh solution below.

Or get 100% fresh solution
Get Custom Quote
Secure Payment