Loading…
Good functions check their inputs before processing:
def divide(a, b):
if b == 0:
return None # or raise an error
return a / b
Create a function safe_average that:
This prevents division by zero errors.
Downloading Python… (one-time, ~10 MB)
This runs entirely in your browser and is cached for next time.