Ticker

6/recent/ticker-posts

Header Ads Widget

Responsive Advertisement

Write a Python program to check the validity of password input by users.

 WRITE A PYTHON PROGRAM TO CHECK THE VALIDITY OF PASSWORD INPUT BY USERS.

INPUT:

import re

p= input("Input your password")

x = True

while x:  

    if (len(p)<6 or len(p)>12):

        break

    elif not re.search("[a-z]",p):

        break

    elif not re.search("[0-9]",p):

        break

    elif not re.search("[A-Z]",p):

        break

    elif not re.search("[$#@]",p):

        break

    elif re.search("\s",p):

        break

    else:

        print("Valid Password")

        x=False

        break

if x:

    print("Not a Valid Password")



OUTPUT:


                                   THANK YOU..!!💫

Post a Comment

0 Comments