#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
#Second Problem
import random
keepplaying=True
print("Play the Guess the Number Game")
while(keepplaying):
    randnum=random.randint(1,100)
    userinput=input("Guess the number between 1 and 100")
    if(randnum==int(userinput)):
        print("Good Job You have won")
    else:
        print("Try again next time!")
    playin=input("Type yes to keep playing and type anything else to stop")
    keepplaying=False
    if(playin.lower()=="yes"):
        keepplaying=True


Play the Guess the Number Game
Try again next time!
Try again next time!