My teacher wants me to find the median of 10 inputs from the user by using iterations.
This is how I used iterations to find the sum, number of odd numbers, the max, and the number of prime numbers. But I'm stuck on finding the median.
def Main(): #main function
    sum=0
    odd=0
    temp=0
    prime=0
    median=0
    for i in range(10):
        x=float(input("Please enter a number")) #ask user for input 10 times
        sum=sum+x #adds all inputs together
        if x%2!=0: #all even numbers are divisible by 2
            odd=odd+1
        if x>=temp: #update temp with current largest input
            temp=x
        for p in range (2,int(math.sqrt(x))+1):#find prime numbers
            if x>=2 and x%p==0: prime=prime+1
 
     
    