Write a python function that takes two numbers. The function divides the first number by the second and returns the answer. The function returns None, if the second number is 0


Topic: Write a python function that takes two numbers. The function divides the first number by the second and returns the answer. The function returns None, if the second number is 0

Solution

def divide(num1, num2):
    if num2 == 0:
        return
    else:
        return num1 / num2



List all Python Programs