+ 1

Why does this not work properly?

So i saw the code of the day and wanted to try something simular but i just cant get it to work. And i cant understand why it does not work can someone explain it to me? Pin = input("Enter your pin please: ") count = 0 while count != Pin: count +=1 if count == Pin: print("Your pin is:", count) break it just goes into an infinite loop of counting.

13th Mar 2018, 2:29 PM
Lordi chan
Lordi chan - avatar
2 Answers
+ 5
In the first line, write Pin = int(input("Enter your pin please: ")) as Pin is an integer 😉
13th Mar 2018, 2:37 PM
777
777 - avatar
+ 2
replace Pin = input("Enter your pin please: ") with Pin = int(input("Enter your pin please: ") )
13th Mar 2018, 2:37 PM
code learner
code learner - avatar