Q. Write a
program that prompts a user for their "password" and then determines
if the password is valid or not. A password is said to be valid if it starts
with a digit and it has length 6 or more. If your program determines that the
user-entered password is not valid, it should print a message saying so.
Otherwise, it should print a message saying that it has accepted the
user-entered password.
Answer =
password = input("Enter the password :- ") if password[0].isdigit() : if len(password) >= 6 : print ("It has accepted the user-entered password") else : print ("The user-entered password is not valid") else : print ("The user-entered password is not valid")
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )