Program to check the authentication of username and password

In this python if else program, we will check authentication of username and password. The name and password of the user should be the same to be valid

Steps to solve the program
  1. Take Username and password as input through the user.
  2. If the username and password is equal then it is authenticate.
  3. Use if-else statement for this purpose.
  4. Print the output.
				
					# Take username and password as input through the user
name = input("Enter name: ")
password = input("Enter password: ")
# Authenticate username and password
if name == password:
# Print output
    print("It is valid")
else:
# Print output
    print("It is not valid")
				
			

Output :

				
					Enter name: sanket
Enter password: 1234
It is not valid
				
			

Related Articles

check a given number is part of the Fibonacci series from 1 to 10.

validate user_id in the list of user_ids.

Leave a Comment