Question

Create a python script in Pycharm: 1) For your script you will need to get input...

Create a python script in Pycharm:

1) For your script you will need to get input from a user, which will ask them to enter a password to be reviewed. This needs to be outside of your functions that you will create for your script. You will be passing the value of the user’s password entered as a parameter value to your functions.

You will be creating four separate functions, you will have one function that verifies whether the user’s password contains at least three digits.

You will have one function that will verify that the user’s password contains at least three lower case characters.

You will have one function that will verify that the user’s password contains at least three upper case characters.

You will also have one function that will verify that the user’s password contains at least three special characters.

If the user’s password that they entered does not meet the requirements of having 3 numbers, 3 lowercase, 3 uppercase, and 3 special characters, your script should tell them that the password they entered does not meet the minimum requirements. It should also tell them the area that does not meet the requirement. For example, if the user enters the password of 123qweASD!, the script should state that the password does not meet the requirement of having three special characters. If the password does meet all requirements the script should tell them, ‘The password entered meets all requirements!’

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

def checkthreedigits(p):
    c = 0
    for i in p:
        if i.isdigit():
            c = c + 1
    if c < 3:
        print('The password does not meet requirement of having three digits')
        return False
    else:
        return True


def checkthreeupper(p):
    c = 0
    for i in p:
        if i.isupper():
            c = c + 1
    if c < 3:
        print('The password does not meet requirement of having three uppercase characters')
        return False
    else:
        return True


def checkthreelower(p):
    c = 0
    for i in p:
        if i.islower():
            c = c + 1
    if c < 3:
        print('The password does not meet requirement of having three lowercase characters')
        return False
    else:
        return True


def checkthreespecial(p):
    c = 0
    for i in p:
        if not (i.isdigit() or i.islower() or i.isupper()):
            c = c + 1
    if c < 3:
        print('The password does not meet requirement of having three special characters')
        return False
    else:
        return True


password = input('Enter a password:')
if checkthreedigits(password) and checkthreeupper(password) and checkthreelower(password) and checkthreespecial(
        password):
    print('The password entered meets all requirements')
else:
    print('The password entered does not meet minimum requirements')

Output:

Add a comment
Know the answer?
Add Answer to:
Create a python script in Pycharm: 1) For your script you will need to get input...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using Python INST-FS-IAD-PROD.INS LAB1 Lab: Create User Account 2. get-password() #promt the user and create password, check the password fits the requirement USE the EXACT file names! Create a user...

    Using Python INST-FS-IAD-PROD.INS LAB1 Lab: Create User Account 2. get-password() #promt the user and create password, check the password fits the requirement USE the EXACT file names! Create a user login system. Your code should do the following: 3, create-user_name() #use this function to create the user name 1.Create your user database called "UD.txt", this should be in CSV format 4, write-file() #user this function to save the user name and password into "UD.txt" Deliverables: Sample: the data you saved...

  • We are trying to make sure your passphrase is acceptable! Write a script that asks for...

    We are trying to make sure your passphrase is acceptable! Write a script that asks for an input string that will be used as your password. This input string will have three “words” separated by a space character. Each of these words has specific requirements, listed below. You must write a function for each requirement (three total functions). Make sure your functions follow the original template that provided. First Function: For the first word, you must check if it is...

  • Create a Python Program that will ask the user for a password (use input) Verify that...

    Create a Python Program that will ask the user for a password (use input) Verify that the password meets the following conditions: -must be 12 characters long -must have uppercase and lowercase -must contain at least 1 special character (!~#$%^&*{}+_) -must be a mix of numbers and letters You must do this only using regular expressions so for instance this will not be accepted if len(password) <12: At the end of the program tell the user their password is ok...

  • Create a Python Program that will ask the user for a password (use input) Verify that...

    Create a Python Program that will ask the user for a password (use input) Verify that the password meets the following conditions: -must be 12 characters long -must have uppercase and lowercase -must contain at least 1 special character (!~#$%^&*{}+_) -must be a mix of numbers and letters You must do this only using regular expressions so for instance this will not be accepted if len(password) <12: At the end of the program tell the user their password is ok...

  • Python Create a function that checks user input in an attempt to create a password. The...

    Python Create a function that checks user input in an attempt to create a password. The valid_password function accepts a password as an argument and returns either true or false to indicate whether the password is valid. A valid password must be at least 7 characters in length, have at least one uppercase letter, one lowercase letter, and one digit. Respond with output to the user as to whether the password is valid or not, and allow the user to...

  • please help me out and input values please .. main cpp.. please follow intructions exactly witj...

    please help me out and input values please .. main cpp.. please follow intructions exactly witj clarity please CSE 110-Intro to Computer Programming Project #3 Requirements-String Class Functions and Test Case Documentation Using the String Class, design and develop a multi-file password validation program and Test case Document (10% of grade) that requests a password, and validates it based on the following criteria. The password must be at least 8 characters long, contain at least one number, and at least...

  • PYTHON CODE ONLY PLEASE, AND COMMENT IN SCRIPT TO SHOW STEPS (post copy-ready text code, and also...

    PYTHON CODE ONLY PLEASE, AND COMMENT IN SCRIPT TO SHOW STEPS (post copy-ready text code, and also a screenshot of code running) You work for an on-line game site. Your job is to develop a program that accepts a user name and password. Write a Python script that prompts users for a user name and password. a. The user name should be at least 6 characters long and is stored in a list such that it 1. can't be used...

  • How do I format this into C++? This the prompt: Design a class named Password that...

    How do I format this into C++? This the prompt: Design a class named Password that stores a password in a c-string and has member functions to test if the password complies with certain requirements as follows: The password should be between 6 and 20 characters long. The password should contain at least one uppercase and at least one lowercase letter. The password should have at least one digit. The password should have at least one punctuation character. Define a...

  • Using the script story.py as an example and possible starting point, write a script that generates a story using multiple levels of function calls that mirror the structure of your story. Your script...

    Using the script story.py as an example and possible starting point, write a script that generates a story using multiple levels of function calls that mirror the structure of your story. Your script must have the following requirements: At least two functions must have randomly determined elements. Your script must accept some form of user input (e.g. name of the hero), which is then used throughout the story. The function structure of your script must have at least four levels....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT