追加不添加到列表 C#

Append not adding to list C#

for(int i = 1; i != amount+1; i++)
            {
                Console.WriteLine("What is the name of the {0} person?", i);
                people.Append(Console.ReadLine());
                Console.WriteLine("What was their grade?");
                grades.Append(Convert.ToDecimal(Console.ReadLine()));
            }

(此部分受影响)

它从用户那里获取输入(即它获取姓名和成绩,尽管它没有添加到数组中。我是 C# 的新手,来自 python。你们有任何知道如何解决这个问题吗?TIA

您在找这样的东西吗?

using System.Collections.Generic;


int amount = 5;
List<string> people = new List<string>();
List<decimal> grades = new List<decimal>();
for (int i = 0; i < amount; i++)
{
Console.WriteLine("What is the name of the {0} person?", i);
people.Add(Console.ReadLine());
Console.WriteLine("What was their grade?");
grades.Add(Convert.ToDecimal(Console.ReadLine()));
}