Python Script

Hello,

I am new to Python. Can you please help me to do the following? I attached Example 4-4 the problem asked.

Write a function that determines whether or not a password is good. We will define a good password to be a one that is at least 8 characters long and contains at least one uppercase letter, at least one lowercase letter, and at least one number. Your function should return True if the password passed to it as its only parameter is good. Otherwise it should return False.
Then use the random password generator from Example 4-4 (copy that function and paste it here) and the function you defined above, write a program that generates a random good password and displays it. Count and display the number of attempts that were needed before a good password was generated. Call the two functions mentioned above from a function named main in the file that you create for this exercise. Ensure that your main program only runs when your solution has not been imported into another file.
Example-4-4.py
Iryna253Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mark BradyPrincipal Data EngineerCommented:
Sounds like homework to me. This is a simple task. You should do some google work and get the answer to each part then put them together. If we write the answer for you then you will be handing in our work and not your own. To help you out, here are some of the search terms you should use.

1: python how to find length of a string
2: python how to how to find if a letter is uppercase or lowercase

As for making sure it will only run if it has not been imported to another file, I will give you that one.

if __name__ == '__main__':
    app = YourClassName()
    app.main()

Open in new window

Assuming your class is call 'YourClassName' then the above code will run your program and execute the code. Good luck and be sure to ask questions along the way. You will feel great when you get this worked out
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Python

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.