C# - Dictionary.Count - not working as expected : The following line of code is not working as expected: If there are two dictionary entries it prints "2, 2" instead of "1, 2"
    
     Console.WriteLine($"Student: {studentMap.Count} - Average Score: {average} - Letter Grade: {GetLetterGrade(average)}");

It is not listing the dictionary count like this line ↓↓↓ of code above it in the other for-loop.

     Console.WriteLine($"Enter test {studentScores.Count + 1 } for student {studentMap.Count + 1 }");

I'm guessing it's an issue with the for-loop but I don't see the problem




      for (int students = 0; students < studentCount; students++)
            {

                List<int> studentScores = new List<int>();
                for (int scores = 0; scores < scoreCount; scores++)
                {
                    string scoreInput = string.Empty;
                    Console.WriteLine(string.Empty);
                    Console.WriteLine($"Enter test {studentScores.Count + 1 } for student {studentMap.Count + 1 }");
                    scoreInput = Console.ReadLine();
                    Console.WriteLine(string.Empty);
                    Console.WriteLine("--------------------");
                    int intScore = Convert.ToInt32(scoreInput);
                    studentScores.Add(intScore);
                }

                studentMap.Add(students, studentScores);
            }
            Console.WriteLine("The test results are as follows:");
            Console.WriteLine(string.Empty);
            for (int i = 0; i < studentMap.Count; i++)
            {
                List<int> studentScores = studentMap[i];
                double scoreSum = studentScores.Sum();
                double scoreNum = studentScores.Count();
                double average = scoreSum / scoreNum;
                Console.WriteLine($"Student: {studentMap.Count} - Average Score: {average} - Letter Grade: {GetLetterGrade(average)}");
            }
            Console.WriteLine();
            Console.ReadLine();
        }