Hackbright Code Challenges

Max of Three: Solution

Max of Three: Solution

Problem

Max of Three

Whiteboard

Easier

Concepts

Math, Conditionals

Download

max-of-three-solution.zip


def max_of_three(num1, num2, num3):
    """Returns the largest of three integers"""

    # START SOLUTION

    if num1 >= num2 and num1 >= num3:
        return num1

    elif num2 >= num1 and num2 >= num3:
        return num2

    elif num3 >= num2 and num3 >= num1:
        return num3

    else:
        return "Something went wrong"