jeudi 27 novembre 2014

One line solution


Vote count:

-1




Hy


I'm learning how to write programs in one line solution. I want this two programs write in one line.


def program1(dict): largest=-100 for i,j in dict.items(): if j>largest: largest=j name=i return name


def program2(items): for i,j in dict.items(): for a in items: if a ==i and j<=-5: return True return False


I want solution like this:


def program2(items): return()


Thanks



asked 1 min ago







One line solution

Aucun commentaire:

Enregistrer un commentaire