Answers for "how to loop through a list"

C#
51

python loop through list

list = [1, 3, 6, 9, 12] 
   
for i in list: 
    print(i)
Posted by: Guest on June-25-2019
8

list loop python

list = [1, 3, 5, 7, 9] 

# with index   
for index, item in enumerate(list): 
    print (item, " at index ", index)
    
# without index
for item in list:
  	print(item)
Posted by: Guest on March-18-2020
2

iterate through a list

my_list = ["Hello", "World"]
for i in my_list:
  print(i)
Posted by: Guest on November-30-2020
4

java loop through list

for (E element : list) {
    . . .
}
Posted by: Guest on October-04-2020
2

iterate a list using iterator

Iterator<String> crunchifyIterator = crunchifyList.iterator();
        while (crunchifyIterator.hasNext()) {
            System.out.println(crunchifyIterator.next());
        }
Posted by: Guest on May-20-2020
0

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); }
Posted by: Guest on January-11-2021

Code answers related to "how to loop through a list"

C# Answers by Framework

Browse Popular Code Answers by Language