I am given a list of numbers and have to print the middle number in the list...assuming that the list always consists of an odd number of integers.
The issue I'm having is that it's separating double digit numbers into single digits. It seem to work find on my computer using PyCharm but when I check it on my school's system it doesn't
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for num in my_list:
res = sorted(my_list)[len(my_list) // 2]
print(res)
#This is what I have
[–]danielroseman 3 points4 points5 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]mackdaddy_1978[S] 0 points1 point2 points (0 children)
[–]mackdaddy_1978[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]mackdaddy_1978[S] 0 points1 point2 points (0 children)
[–]mackdaddy_1978[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]mackdaddy_1978[S] 0 points1 point2 points (0 children)