vendredi 28 septembre 2018

How to write lambda function with three conditions

I want to write a function that gives returns 3 if x>y returns 1 if x==0 and returns 0 if x

def make_points():
    return lambda x,y: 3 if x>y else 0 

I tried this but I want to add another condition.

Aucun commentaire:

Enregistrer un commentaire