f = lambda x: 2*x + 5 print f(3) print f(5) f = lambda x : x%2 and "Odd" or "Even" print "5 is",f(5) print "10 is",f(10)
Output:
11 15 5 is Odd 10 is Even
f = lambda x: 2*x + 5 print f(3) print f(5) f = lambda x : x%2 and "Odd" or "Even" print "5 is",f(5) print "10 is",f(10)
11 15 5 is Odd 10 is Even
0 comments:
Post a Comment