Junior — Middle
Have you had practical experience using type annotations in Python 3.6?
sobes.tech AI
Answer from AI
In Python 3.6, type annotations were introduced, allowing you to specify expected argument types and return types of functions. This does not affect code execution but helps static analysis tools (like mypy) and improves readability.
Example:
from typing import List
def greet_all(names: List[str]) -> None:
for name in names:
print(f"Hello, {name}")
Practical experience usually involves adding such annotations to existing code to enhance reliability and maintainability.