fork download
  1. # http://c...content-available-to-author-only...e.com/a/51837/34718
  2.  
  3. f=lambda l:min(l)*all(x>0for x in l)+max(l)*all(x<0for x in l)
  4.  
  5. print f([2,3,4]), f([-4,-5,-9]), f([4,-3,8])
  6.  
  7. f=lambda l:eval("+m%s%s(l)*all(x%s0for x in l)"*2%tuple("ax<in>"))
  8.  
  9. print f([2,3,4]), f([-4,-5,-9]), f([4,-3,8])
  10.  
Success #stdin #stdout 0.01s 7736KB
stdin
Standard input is empty
stdout
2 -4 0
2 -4 0