Write a python function that calculates the midpoint between two numbers


Topic: Write a python function that calculates the midpoint between two numbers

Solution

def midpoint(a, b):
    lar = b if b > a else a
    sm = a if b > a else b
    return float(lar + sm) / 2



List all Python Programs