Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def medyan(list):
- if len(list) % 2 ==1:
- ortanca=(len(list)-1)/2
- i=0
- j=1
- while j<=len(list)-1:
- if list[i]<list[j]:
- en_kucuk=list[i]
- j=j+1
- else:
- en_kucuk=list[j]
- i=j
- j=j+1
- if len(list)==ortanca:
- break
- else:
- list.remove(en_kucuk)
- continue
- print ("medyan=",en_kucuk)
- list=[18,19,4,6,7,8,3]
- medyan(list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement