Advertisement
Guest User

Untitled

a guest
May 29th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. def medyan(list):
  2. if len(list) % 2 ==1:
  3. ortanca=(len(list)-1)/2
  4. i=0
  5. j=1
  6. while j<=len(list)-1:
  7. if list[i]<list[j]:
  8. en_kucuk=list[i]
  9. j=j+1
  10. else:
  11. en_kucuk=list[j]
  12. i=j
  13. j=j+1
  14. if len(list)==ortanca:
  15. break
  16. else:
  17. list.remove(en_kucuk)
  18. continue
  19.  
  20. print ("medyan=",en_kucuk)
  21. list=[18,19,4,6,7,8,3]
  22. medyan(list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement