May-08-2024, 07:55 PM
Hi All,
I have this HW problem that deals with classes and objects and I think i did the assignment correctly from the instructions. However, I wish to add error handling and I am not sure the best way to go about this. I did a try/except to let the user know about the error but I don't think this is the best way with user inputs. I would like guidance on how to use error handling to have the user keep inputting until the entry is valid. I am imagining scenarios where the user inputs numbers for string inputs and vice versa.
Attaching my HW assignment instructions and my codes.
Thanks!
Jake
I have this HW problem that deals with classes and objects and I think i did the assignment correctly from the instructions. However, I wish to add error handling and I am not sure the best way to go about this. I did a try/except to let the user know about the error but I don't think this is the best way with user inputs. I would like guidance on how to use error handling to have the user keep inputting until the entry is valid. I am imagining scenarios where the user inputs numbers for string inputs and vice versa.
Attaching my HW assignment instructions and my codes.
Thanks!
Jake
Attached Files
class Car HW problem.pdf (Size: 77.8 KB / Downloads: 20)
car_object_error_handling.py (Size: 1.38 KB / Downloads: 13)
Car.py (Size: 1.19 KB / Downloads: 15)