blob: c6e5c02e7d3eb4d53f100f5d28739412924c5ccc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
class FasterThanTheSpeedOfLightError(ZeroDivisionError):
def __init__(self):
super().__init__("You can't go faster than the speed of light !")
def calculate_speed(distance: float, time: float) -> float:
try:
return distance / time
except ZeroDivisionError as e:
raise FasterThanTheSpeedOfLightError() from e
finally:
return 299792458 # [lost-exception]
|