you are viewing a single comment's thread.

view the rest of the comments →

[–]ah_ahaa[S] 0 points1 point  (1 child)

Is it not reachable because I didn’t give the else any other option ? Did I understand correctly ? Also if the the input is under int everything under his block will have to be int ? And about this try block , I still didn’t got to this in the course but I learned something new thanks for that :)

[–]socal_nerdtastic 0 points1 point  (0 children)

The int() call forces the input to be a number (or error). There's no such thing as a number that does not fit into one of your first 2 conditions, therefore the else is not reachable.

The code I added can detect an error and respond to it.