Top "List" questions

The list tag may refer to: a linked list (an ordered set of nodes, each referencing its successor), or a form of dynamic array.

How to check if all elements of a list matches a condition?

I have a list consisting of like 20000 lists. I use each list's 3rd element as a flag. I want to …

python list for-loop while-loop
Add list to set?

Tested on Python 2.6 interpreter: >>> a=set('abcde') >>> a set(['a', 'c', 'b', 'e', 'd']) &…

python list set
Does java.util.List.isEmpty() check if the list itself is null?

Does java.util.List.isEmpty() check if the list itself is null, or do I have to do this check …

java list
Sorting list based on values from another list?

I have a list of strings like this: X = ["a", "b", "c", "d", "e", "f", "g", "h", "i"] Y = [ 0, 1, 1, 0, 1, 2, 2, 0, 1 ] What …

python list sorting
Test if a variable is a list or tuple

In python, what's the best way to test if a variable contains a list or a tuple? (ie. a collection) …

python types list
Python List vs. Array - when to use?

If you are creating a 1d array, you can implement it as a List, or else use the 'array' module …

python arrays list
Summing elements in a list

Here is my code, I need to sum an undefined number of elements in the list. How to do this? …

python list sum
Linq select objects in list where exists IN (A,B,C)

I have a list of orders. I want to select orders based on a set of order statuses. So essentially …

c# linq list linq-to-objects exists
Best way to convert list to comma separated string in java

I have Set<String> result & would like to convert it to comma separated string. My approach would …

java string list collections set
Explicitly select items from a list or tuple

I have the following Python list (can also be a tuple): myList = ['foo', 'bar', 'baz', 'quux'] I can say >&…

python list select indexing tuples