# the above code gives the user unlimited chances. let's make it to 3. so that if the user enters the password wong for 3 times it will stop him from logging in again
p = input("Enter the password: ") # the user is supposed to enter the password
password = 'python'#this the password with which the user have to log in - i.e. this the correct log in password
imax = 3
i=1
while p != password:
i=i+1
p = input("Password is wrong Enter again: ")
if i == imax:
break
if i !=imax:
print("Password is correct. and the information you are looking is here")
else:
print("Password is wrong")
Enter the password: pine Password is wrong Enter again: ink Password is wrong Enter again: aks Password is wrong
# the above code gives the user unlimited chances. let's make it to 3. so that if the user enters the password wong for 3 times it will stop him from logging in again
p = input("Enter the password: ") # the user is supposed to enter the password
password = 'python'#this the password with which the user have to log in - i.e. this the correct log in password
imax = 3
i=1
while p != password:
i=i+1
p = input("Password is wrong Enter again: ")
if i == imax:
break
if i !=imax:
print("Password is correct. and the information you are looking is here")
else:
print("Password is wrong")
Enter the password: pine Password is wrong Enter again: python Password is correct. and the information you are looking is here