Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a python function password_check() that takes as input two strings newpass

ID: 3916010 • Letter: W

Question

Write a python function password_check() that takes as input two strings newpassword and oldpassword, and that accepts the new password (i.e., returns True) if newpassword is different from oldpasswordand newpassword is at least 6 letters long. If the new password fails the check, your functions should return False. Test your program by passing different values to the function as shown below.

Sample runs:

password_check('E10-s2ff', 'E10.s2ff')

True

password_check('E10sf', 'E10.s2ff')

False

password_check('E10-s2ff', 'E10-s2ff')

False

Explanation / Answer

def password_check(newpassword, oldpassword): return len(newpassword) >= 6 and newpassword != oldpassword print(password_check('E10-s2ff', 'E10.s2ff')) print(password_check('E10sf', 'E10.s2ff')) print(password_check('E10-s2ff', 'E10-s2ff'))

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote