Cody Bable

Generation

generate functionSun, 23 Apr 2023

try except a division by zero

def divide(a, b): try: return a / b except ZeroDivisionError: return "Division by zero is not allowed."

Questions about programming?Chat with your personal AI assistant