Created
March 23, 2024 14:16
-
-
Save pschanely/7877e51e735bd9c2049cc7d4aeb859cb to your computer and use it in GitHub Desktop.
Shared via CrossHair Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
def average(numbers: List[float]) -> float: | |
''' | |
pre: len(numbers) >= 0 | |
post: min(numbers) <= __return__ <= max(numbers) | |
''' | |
return sum(numbers) / len(numbers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment