password = raw_input("Enter password: ")
if password == "1234":
print "You logged in correctly!"
else:
print "GTFO"
Though i give different indentations the code is working fine i'm unable to figure it out.
it will not be flagged as as IndentationError, sine any block of statement has to have at lease 1 space of indent
here your if and else are two different blocks, so it was indented anyway so the interpreter throws no error
if True:
print
elif True:
print
elif True:
print
elif True:
print
else:
print
This will work without any problem
But if I try the following I will get IndendationError
if True:
print ""
print "" # has different Indentation
print ""
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With