Computer Science, asked by ganeshparking, 4 months ago

write a Python program to read a list of N integers and find their medium ( median value of a list of value is N the middle one when they are arranged in order if there are two middle values then take their average value )​

Answers

Answered by sspkchannel
0

Answer:

lst = eval(input("Enter a list :-"))

lst.sort()

length = len(lst)

if length % 2 == 0 :

med = ( lst [ length // 2 - 1 ] + lst [ (length // 2) ]) / 2

else :

med = lst [ (length // 2) -1 ]

print("Median :-",med)

Similar questions