i am new to python programming.is it possible to raise exception in python without using try except block (or)only with except (or)only with try block.
Thanks
Mukthyar
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You don’t need it to be in a try..except block but when you raise an exception you always want to catch it and handle it somewhere in your code. That is the use of the try..except block. You would need to use it somewhere in your code to handle the raised exception else the exception will halt the execution of your program.