+ 1
Again I am stuck on indentation. Somebody please help me this
pin = input() try: int(pin) print("PIN code is created") except ValueError: print("Please enter a number")
6 Respuestas
+ 2
pin = input()
try:
int(pin)
print("PIN code is created")
except ValueError:
print("Please enter a number")
# You need to give 4 spaces to each line inside the block
+ 3
Oh, I usually use 2 spaces. it works ...Ratnapal Shende thank you
+ 2
while True:
pin = input("Enter a number : ")
if pin.isdigit():
print("Pin is generated !")
break
else:
print("Please Enter a number !")
# just for fun :)
+ 2
Kashish Khan it even works with 2 spaces for all conditions...try and see
+ 2
Thank you to both of you