#4z: Coding in Python {Sorter}


 116 times better than this garbage .

  1. n = int(input('No of terms: '))
  2. itema = []
  3. for i in range(n):
  4.     t = int(input("Enter numbers: "))
  5.     itema.append(t)    
  6. def ran(di):
  7.     global want
  8.     low = di[0]    
  9.     for i in (di):
  10.         if i<low:low=i  
  11.     return low
  12. test1 = []
  13. for i in range (n):
  14.     test1.append(ran(itema))
  15.     itema.remove(ran(itema))
  16. print(test1)
  17. test1.reverse()
  18. print(test1)

I would like to thank Mr. Abdul Rahmani for suggesting major changes.
Download the above code from here.

Comments