Type Hint
Domain: Programming Fundamentals
π― Motivation
Type hints annotate variables and functions with expected types, making code clearer and enabling tool support.
π Concrete Example
def greet(name: str) -> str: return 'Hello, ' + name - hints say name should be a string and the function returns a string.
π Analogy
Labels on containers - βthis jar is for sugar, this one for saltβ. The label doesnβt stop you from putting salt in the sugar jar, but it helps you avoid mistakes.