I have a little bit of trouble finding the median in a list. I am trying to ask the user what his/her marks are and i am trying to find the median. I have a little bit of trouble because the user could be inputting either an odd or an even number of marks but i don't know how to ask him/her. it would be great if someone could help me. This is what i have so far:
Code:
mark = 0
count = 0
yourmarks =[]
while True:
marks = input("Enter student marks here[-1 to stop]")
yourmarks.append(marks)
count += 1
if marks == -1:
break
print "Your highest mark is",max(yourmarks)
del yourmarks[-1]
print "Your lowest mark is", min(yourmarks)
Comment