📜  遍历列表 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:28.540000             🧑  作者: Mango

代码示例3
List list = new List { 1, 2, 3, 4, 5 };
//For Loop
for (int i = 0; i < list.Count(); i++)
{ Console.WriteLine(list[i]); }

//For Each Loop
foreach (int item in list)
{ Console.WriteLine(item); }