How to acces items from a list by their index?

Hello! Can you please help me with this :
colorsequence = New List(Of String)
And I added to collection these: red red black red black black
while i>=0:
color = colorsequence(i) // the color is string
print: color
assign: i = i +1
so I want the variable color to get the colors and print them but I don’t know how to acces the items from colorsequence list
the return should be like this: red red black red black black


Hope the following helps you.


Main.xaml (7.3 KB)


Thank you so much !!

1 Like


You can use For Each activity instead of While loop also

Usually, While loop we loop if we don’t have a list of items

You have list of items so you can use For Each loop and for track on index you can declare a variable for Index in the For Each activity properties

Hope this may help you