Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to loop through a list

List<int> list = new List<int> { 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); }
 
PREVIOUS NEXT
Tagged: #loop #list
ADD COMMENT
Topic
Name
9+7 =