[SOLVED] CSE101 Lab 3 – Errors and Exceptions Exceptions

39.99 $

Category: Tags: ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon CSE101-Lab3-main-xtxezl.zip (420.5 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

 

• Why would you ever expect errors?
• If you can expect something, can’t you prevent that?

Exceptions

try:
<Your statements here> except <Name of first exception you wish to handle>:
<Your emergency code here> except <Name of first exception you wish to handle>:
<Your other emergency code here> else:
<If no exception…>
Exercise

You are expected to finish this task in less
than 60min
Closely examine the skeleton code (lab3.py) to infer the data types
• You are not allowed to change existing codes
• Only fill in the ‘TODO’ parts
Exercise

Task 1 Use exception handling to take care of the number format
• These dates should strictly consist of numbers
• Forcibly converting a non-numeric string to a number will result in an exception
Task 2 Use string methods to achieve the same result
• How do you find out if the string consists of numbers?
• You can find the appropriate method in the class slides or in the python documentation

  • CSE101-Lab3-main-xtxezl.zip