Is
text.startswith(\'a\')
better than
text[0]==\'a\'
?
Knowing text is not empty and we a
text[0] can fail but the equivalent text[:1] is safe if the string is empty.
text[0]
text[:1]
If you want to compare more than one characters, I believe .startswith() is better.
.startswith()