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); }
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #loop #list
ADD COMMENT
Topic
Name
4+1 =