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 concatenate items in a list to a single string?

Is there a simpler way to concatenate string items in a list into a single string? Can I use the …

python string list concatenation
Check if something is (not) in a list in Python

I have a list of tuples in Python, and I have a conditional where I want to take the branch …

python list conditional membership
Python - Create list with numbers between 2 values?

How would I create a list with values between two values I put in? For example, the following list is …

python list
Finding the average of a list

I have to find the average of a list in Python. This is my code so far l = [15, 18, 2, 36, 12, 78, 5, 6, 9] print reduce(…

python list lambda average reduce
Convert all strings in a list to int

In Python, I want to convert all strings in a list to integers. So if I have: results = ['1', …

python list int
How do you split a list into evenly sized chunks?

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate …

python list split chunks
How can I compare two lists in python and return matches

I want to take two lists and find the values that appear in both. a = [1, 2, 3, 4, 5] b = [9, 8, 7, 6, 5] returnMatches(a, b) would …

python list
Python - Count elements in list

I am trying to find a simple way of getting a count of the number of elements in a list: …

python list
How to remove the first Item from a list?

I have the list [0, 1, 2, 3, 4] I'd like to make it into [1, 2, 3, 4]. How do I go about this?

python arrays list
Getting the index of the returned max or min item using max()/min() on a list

I'm using Python's max and min functions on lists for a minimax algorithm, and I need the index of the …

python list max min