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

This program will be ran through a Python 3 IDE. Write a function password_check

ID: 3669497 • Letter: T

Question

This program will be ran through a Python 3 IDE.

Write a 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 oldpassword and 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)
   a=len(newpassword)
   b=len(oldpassword)

   if b>6 and newpassword != oldpassword:
       return true;
   else:
       return false;

password_check()

def main()
print password_check('E10-s2ff', 'E10.s2ff');
print password_check('E10sf', 'E10.s2ff');
print password_check('E10-s2ff', 'E10-s2ff');
main()

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