I was bitten so many times by un-indented code, thanks to copy / paste that took me hours for figure out what was the actual problem.
I wish Python had closing...how do we call them, tags(?), clauses?
Anyway, here's an example of what I mean:
Before:
def IsPalindrome(s) -> bool:
for i in range(len(s)):
if s[i] != s[len(s)-1-i]:
return False
return True
print("Is Anna a palindrome?", IsPalindrome('ANNa'.lower()))
after: def IsPalindrome(s) -> bool
for i in range(len(s))
if s[i] != s[len(s)-1-i]
return False
endif
endfor
return True
enddef
print("Is Anna a palindrome?", IsPalindrome('ANNa'.lower()))