t-rexdex / py_bootcamp

Python Bootcamp
0 stars 0 forks source link

Input validation #3

Closed huytran187 closed 1 year ago

huytran187 commented 1 year ago

https://github.com/t-rexdex/py-bootcamp/blob/5c63fe345da2dea51dc46e062e967da48cee2133/school-catalogue/main.py#L5

huytran187 commented 1 year ago

the assignment says that the name is either “primary”, “high”… watever watever

Now, you will want to ensure the user inputs the correct thing for example , if i give something like “pan cake”, your class will (for now) prints a message to console “Your input is invalid, posssibles options are (blah blah)” and for invalid input, you will default it to a default value, up to you to choose watver default that’d be

UPDATE1: for invalid input, in this case, you won't init a default value. THe sensible choice is to raise valueerror here

t-rexdex commented 1 year ago

Completed this issue in OOP project PR #8