#First Problem
classgrades=[19,41,99,81,70,69]
print(classgrades)
classgrades.sort()
if(len(classgrades)%2==1):
median_value=classgrades[int(len(classgrades)/2)]
else:
median_value=classgrades[int(len(classgrades)/2)-1]+classgrades[int(len(classgrades)/2)]
median_value/=2
classgrades=[str(i) for i in classgrades]
print()
print("The sorted classgrades from least to greatest is "+' '.join(classgrades))
print("The median of the classgrades is",median_value)
[19, 41, 99, 81, 70, 69]
The sorted classgrades from least to greatest is 19 41 69 70 81 99
The median of the classgrades is 69.5
Play the Guess the Number Game
Try again next time!
Try again next time!