# list of class grades
class_grades = [65, 78, 79, 87, 94, 98, 95, 97, 96, 97, 96, 97, 100]

# sort the list in ascending order
class_grades.sort()

#  calculate the median
n = len(class_grades)

if n % 2 == 0:
    # ff the number of elements is even, the median is the average of the middle two elements
    median_value = (class_grades[n // 2 - 1] + class_grades[n // 2]) / 2
else:
    # ff the number of elements is odd, the median is the middle element
    median_value = class_grades[n // 2]

print("Median:", median_value)

Median: 96
import random

# random number between 0 and 1
random_number = random.randint(0,1)

# gets user input for heads or tails and sets it to lower case to avoid and case issues
user_guess = input('Heads or Tails? ').lower()

# checks to see if user guess it same as computer's random number guess
if random_number == 0 and user_guess == 'heads':
    print('You guessed correctly! It was heads!')
elif random_number == 0 and user_guess == 'tails':
    print('You guess incorrectly! It was tails!')
elif random_number == 1 and user_guess == 'tails':
    print('You guessed correcly! It was tails!')
elif random_number == 1 and user_guess == 'heads':
    print('You guessed incorrectly! It was tails!')
heads
You guessed incorrectly! It was tails!

##