I am confused as to why the loop started even though I got the correct pin in this scenario. code:
attempts = 0
pin = int(input("PIN: "))
if pin == 4321:
print("Correct! It only took you one single attempt!")
while pin != 4321:
pin = int(input("PIN: "))
if pin == 4321:
attempts += 1
break
elif pin !=4321:
attempts += 1
print("Wrong")
print("Correct! It took you {} attempts".format(attempts))