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.

List<T> OrderBy Alphabetical Order

I'm using C# on Framework 3.5. I'm looking to quickly sort a Generic List<T>. For the sake of …

c# generics list lambda sorting
How to sort a list/tuple of lists/tuples by the element at a given index?

I have some data either in a list of lists or a list of tuples, like this: data = [[1,2,3], [4,5,6], [7,8,9]] data = [(1,2,3), (4,5,6), (7,8,9)] And …

python list sorting tuples
Select distinct using linq

I have a class list of class public class LinqTest { public int id { get; set; } public string value { get; set; } } …

c# linq list class
How would you make a comma-separated string from a list of strings?

What would be your preferred way to concatenate strings from a sequence such that between every two consecutive pairs a …

python string list
How do I clone a generic list in C#?

I have a generic list of objects in C#, and wish to clone the list. The items within the list …

c# generics list clone
Using LINQ to remove elements from a List<T>

Say that I have LINQ query such as: var authors = from x in authorsList where x.firstname == "Bob" select x; …

c# .net linq list
Is there a short contains function for lists?

I see people are using any to gather another list to see if an item exists in a list, but …

python list search collections contains
if else in a list comprehension

I have a list l: l = [22, 13, 45, 50, 98, 69, 43, 44, 1] For numbers above 45 inclusive, I would like to add 1; and for numbers less than …

python list list-comprehension if-statement
Convert tuple to list and back

I'm currently working on a map editor for a game in pygame, using tile maps. The level is built up …

python list tuples
List to array conversion to use ravel() function

I have a list in python and I want to convert it to an array to be able to use …

python arrays list numpy