prof-rossetti / intro-to-python

An Introduction to Programming in Python
Other
97 stars 244 forks source link

Static Typing / Function Annotations #81

Open s2t2 opened 3 years ago

s2t2 commented 3 years ago

Add this to the notes about functions:

"for example, this function is expected to take two int arguments and is also expected to have an int return value:"

def sum_two_numbers(a: int, b: int) -> int:
   return a + b

References: