Simple Compute Pay Function Can this be made any simpler/shorter/more efficient?

This function will compute paycheck amount according to hours worked and rate per hour.

def compute_pay(hours: int, rate: float) -&gt; float:
    """Computes pay according to hours worked and rate per hours.

    For every hour worked after the 40th hour the rate per hour
    is multipled by 1.5
    """

    pay = 0

    if hours &gt; 40:
        pay += 40 * rate
        hours -= 40
        pay += hours * rate * 1.5
    else:
        pay = hours * rate

    return pay


hrs = int(input('Hours: '))
hrs_rate = float(input('Rate: '))

print('Pay:', compute_pay(hrs, hrs_rate))


This is my second take on the above function:

def compute_pay(hours: int, rate: float) -&gt; float:
    """Computes pay according to hours worked and rate per hours.

    For every hour worked after the 40th hour the rate per hour
    is multipled by 1.5
    """

    hours -= 40

    if hours &gt; 0:
        pay = 40 * rate + (hours * rate * 1.5)
    else:
        pay = (hours + 40) * rate

    return pay


hrs = int(input('Hours: '))
hrs_rate = float(input('Rate: '))

print('Pay:', compute_pay(hrs, hrs_rate))


My aim is to have begginers' friendly logic while introducing Python features.
Welcome to Code Review. I think the simpler way of expressing your code would look like this:

def compute_pay(hours: int, rate: float) -&gt; float:
    return (min(hours, 40) + (max(0, hours - 40) * 1.5)) * rate

hrs = int(input('Hours: '))
hrs_rate = float(input('Rate: '))

print('Pay:', compute_pay(hrs, hrs_rate))