1. Other
  2. Other
  3. andnbspandmiddotandnbspandnbspandnbspandnbspandnbspandnbsplearning objective using python methods and functionsandnbspproblem descriptionandnbspsome websites impose...

Question: andnbspandmiddotandnbspandnbspandnbspandnbspandnbspandnbsplearning objective using python methods and functionsandnbspproblem descriptionandnbspsome websites impose...

Question details

 

·      Learning Objective: Using Python Methods and Functions

 

Problem Description:

 

Some Websites impose certain rules for passwords, involving use of certain numbers and special characters.

 

Write a Python program that prompts the user to enter a password and displays "valid password" if the rule is follows rules of the company, or "invalid password" otherwise.

 

Write a method or a function for implementing the password checking rules for the method/function as follows:

 

·     A password must have at least eight characters.

·     A password must consist of only letters and digits.

·     A password must contain at least two digits.

                    

Sample 1

Enter a string for password: wewew43x

valid password

 

Sample 2

Enter a string for password: 343a

invalid password

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution