@clcoding Answer: C
Solution: If we understand the try-except structure, we can easily solve this question.
So let's get into:
1. What try-except is for
2. How try-except works
3. Getting the answer for this code snippet
Ready?
+
@clcoding 1. What try-except is for
try-except is a feature in Python, for the purpose of Error Handling.
Let's understand the concept of Error Handling
Sometimes, we suspect that certain pieces of code will throw errors.
And, I don't mean errors due to our own typos, but
+
@clcoding related to something else we possibly can't control.
For example, say you ask the user to enter a number.
user_input_str = input("A number please? ")
the `input` function gives the string typed by the user.
So, we convert it into int
user_input_int = int(user_input_str)
+