In [5]:
def iris_predictor(petal_length, petal_width):
    if petal_width <= 2.45:
        return "Class 1"
    if petal_length <= 1.75:
        if petal_width <= 4.85:
            return "Class 3"
        if petal_width <= 4.95:
            if petal_length <= 1.65:
                return "Class 2"
            if petal_length <= 1.55:
                return "Class 3"

In [6]:
iris_predictor(4.5, 1.51)


Out[6]:
'Class 1'

In [ ]: