Why does list.index throw an exception, instead of using an arbitrary value (for example, -1)? What\'s the idea behind this?
-1
To me it looks cleaner to d
To add to Devin's response: This is an old debate between special return values versus exceptions. Many programming gurus prefer an exception because on an exception, I get to see the whole stacktrace and immediate infer what is wrong.