def add(x: int, y: int) -> int:
return x + y
result = add("3", "4")What happens when this code runs?
- aIt runs fine; result becomes the string "34"✓
- bIt raises a TypeError as soon as the function is defined
- cIt raises a TypeError when the function is called
- dIt runs fine; result becomes the integer 7
Explanation:Type hints are purely advisory metadata for tools like mypy; the interpreter never checks them at runtime.
"3" + "4" is plain string concatenation, so result is "34".