+ 1
pin = int(input()) try: print ("PIN code is created") except ValueError : print ("Please enter a number")
Pls what am I doing wrong in this code
3 Answers
+ 5
try:
pin = int(input())
except ValueError :
print ("Please enter a number !")
else:
print("Pin is Correct !")
+ 5
Read <pin> as string first. Do the conversion to `int` inside the `try` block.
+ 3
It works, thank you very muchš. It was starting to get frustrating already