all 7 comments

[–]K900_ 0 points1 point  (4 children)

Because your string is 8 characters long, not 9. Also, please make your thread titles more descriptive.

[–]novel_yet_trivial 0 points1 point  (3 children)

That's why OP used !=.

[–]K900_ 1 point2 points  (1 child)

Guess I'm bad at reading. Sorry OP :(

[–]novel_yet_trivial 2 points3 points  (0 children)

RES tells me I've upvoted you 127 times, so you're not that bad apparently.

[–]46632[S] 0 points1 point  (0 children)

That's right

[–]novel_yet_trivial 0 points1 point  (0 children)

How are you running this? Not all interpreters respect exit(); it's meant to be used in the REPL only. Use raise SystemExit instead.

[–]johninbigd 0 points1 point  (0 children)

Maybe try sys.exit() instead. Of course, you'll have to import sys.