Array Python Sort custom


SUBMITTED BY: amonian

DATE: Jan. 7, 2017, 3:51 a.m.

FORMAT: Python

SIZE: 282 Bytes

HITS: 1330

  1. Python Awesome !!!!!!!!!!!
  2. def lac_lu(array):
  3. a = sorted(array)
  4. for i in range(0,len(a)):
  5. if i % 2 == 0:
  6. print a[i]
  7. else :
  8. print a[len(a)-i]
  9. L =[1, 2, 3, 4,5,8,3,2,1,9]
  10. lac_lu_2 = lambda L: sorted(L)
  11. print lac_lu_2(L)

comments powered by Disqus