input: Write a python function to grade student test scores against an answer key.
  assert grade_test({'Q1': 'A', 'Q2': 'B', 'Q3': 'C'}, {'Alice': {'Q1': 'A', 'Q2': 'B', 'Q3': 'C'}, 'Bob': {'Q1': 'A', 'Q2': 'A', 'Q3': 'C'}}) == {'Alice': {'total_correct': 3, 'percent': 100.0}, 'Bob': {'total_correct': 2, 'percent': 66.66666666666666}}
  assert grade_test({'Q1': 'D', 'Q2': 'B', 'Q3': 'C'}, {'Charlie': {'Q1': 'A', 'Q2': 'B', 'Q3': 'C'}, 'Dana': {'Q1': 'D', 'Q2': 'B', 'Q3': 'A'}}) == {'Charlie': {'total_correct': 2, 'percent': 66.66666666666666}, 'Dana': {'total_correct': 2, 'percent': 66.66666666666666}}
output: def grade_test(answer_key, student_answers):
      results = {}
      total_questions = len(answer_key)
      
      for student, answers in student_answers.items():
          correct_count = sum(1 for q, a in answers.items() if answer_key.get(q) == a)
          percent_correct = (correct_count / total_questions) * 100
          results[student] = {
              'total_correct': correct_count,
              'percent': percent_correct
          }
      
      return results