A nicer way to handle code errors
In most programming languages it is possible to put the code in a try/except block. Try is a piece of code where error is expected, except block is piece of code to be executed, when an error occurs within try block. But a program should work flawlessly. Exactly! Unless a program asks a person to enter data. For example code does division of one number by another one. A program may ask a user for an input, but a user may enter a character instead of a number. Dividing a number by a character is an invalid operation. Try/except block will help to handle such an error. Why try/except block is important? Instead of cryptic error messages, a coder may display a much nicer message to a user. For example "Division by zero" is not permitted, a coder may print a message that a number must be greater than zero. YouTube video Try/Except Blocks: A Study Guide Quiz (Short Answer) Answer the following questions in 2-3 sentences each. What is the primary purpose of using a try/except block...