Password validation

Report a typo

Write a program that checks if the user password fulfills the following requirements:

  • The password contains only alphanumeric ASCII characters.
  • The password length is from 6 to 15 characters long.
  • The password does not start (ends) with whitespace.

If the input matches the requirements, the program should output Thank you! or Error! if otherwise.

Sample Input 1:

password123

Sample Output 1:

Thank you!
Write a program in Python 3
import re

password = input()
# your code here
___

Create a free account to access the full topic