Python Errors and Exceptions: How to Use try, except, else and finally
Ravindra Bagale's Tip — Chala mitrano
Errors are not your enemy. They are Python telling you exactly what went wrong. Today we learn to read error messages and to handle bad data without crashing.
Ravindra Bagale's Tip – चला मित्रांनो
Errors तुमचे शत्रू नाहीत. काय चुकलं ते Python नेमकं सांगतो. आज error messages वाचायला आणि crash न होता खराब data हाताळायला शिकू.
Ravindra Bagale's Tip – चलो दोस्तों
Errors आपके दुश्मन नहीं हैं. क्या गलत हुआ, Python ठीक-ठीक बताता है. आज error messages पढ़ना और बिना crash हुए खराब data संभालना सीखेंगे.
What you will learn in this chapter
- How to read a Python error message
- Common error types in data work
- try and except
- Catching specific errors
- else and finally
- Raising your own errors for bad data
Practice data
All names, shops, banks, hospitals and amounts in this chapter are made up for learning. They are not real people or real company numbers.