Exibir no console a média de todas as notas de cada aluno, para cada linguagem:
var notasAlunos = new Dictionary<string, Dictionary<string, List<int>>> {
{ "Ana", new Dictionary<string, List<int>> {
{ "C#", new List<int> { 8, 7, 6 } },
{ "Java", new List<int> { 7, 6, 5 } },
{ "Python", new List<int> { 9, 8, 8 } }
}},
{ "Maria", new Dictionary<string, List<int>> {
{ "C#", new List<int> { 6, 5, 4 } },
{ "Java", new List<int> { 8, 7, 6 } },
{ "Python", new List<int> { 6, 10, 5 } }
}},
{ "Luiza", new Dictionary<string, List<int>> {
{ "C#", new List<int> { 2, 3, 10 } },
{ "Java", new List<int> { 8, 8, 8 } },
{ "Python", new List<int> { 7, 7, 7 } }
}}
};
Console.WriteLine(@"
**************************
Média das notas dos alunos
**************************");
void ExibirMediaDeNotas()
{
foreach (string aluno in notasAlunos.Keys)
{
Console.WriteLine($"\n{aluno}: ");
foreach (string language in notasAlunos[aluno].Keys)
{
double media = notasAlunos[aluno][language].Average();
Console.WriteLine($" * {language}: {media}");
}
}
}
ExibirMediaDeNotas();