Skip to main content

Python Username and Password using if .. else

 Easy ways to check username and password by using simple if else statement.


Ex.

username = "saransh"

password = "Saransh77"

x = input("enter your username- ")

y = input("enter your password- ")

if x == username:

if y == password:

print("Okay Right..!")

else:

print("please enter correct username or password.")



OUTPUT



Comments

Popular posts from this blog

Reverse String In Python By Simple Methods

  x = "Code By Saransh" y = x[::-1] print(y) OUTPUT hsnaraS yB edoC

Python If...else Statement

  Simple If  Statement x = 23 if x > 0: print("x is positive value") print("this is always printed") x = -1 if x > 0: print(x, "is positive number") print("this is also always printed") Output If...Else statement a = -7 if a > 0: print(a, " is positive") else: print(a," is Negative") output