Why add "try/except" to 2 lines in this question?

On further thought I think I understand the issue with this question. The question declared a variable with a constant value “5 degrees” but what it probably meant to say is “Imagine that a user provided this value, and we didn’t know what they had given, that is, a number or possibly some alphanumeric value. In this case, which lines could cause a problem/exception?” If it had been worded that way instead of giving us a hardcoded value to transform, then the answer “3/4” now makes sense. I noticed I am not the only person to ask about this problem and it seems that the responses given in the past were not that clear. So I am writing my thoughts here in case it helps the next person who doesn’t understand the answer.

1 Like