I have the following code to prompt entries and to calculate a median. It works fine for an odd number of entries, but for even entries when it needs to take the average of 2 middle numbers I get a type error.
import statistics
x=input("How many numbers do you want to enter? ")
x=int(x)
tup=()
for i in range(0,x):
y=input("Enter number ")
tup+= (y,)
print("Median= ",statistics.median(tup))
How can I fix this?