Most voted "list" questions
A list is an abstract type of data that represents a sequence of values, in which the same value can occur more than once. The main ways to implement a list is through an array (array, vector or one-dimensional matrix) or a chained list.
Learn more…1,022 questions
Sort by count of
-
1
votes1
answer79
viewsHow to modify a list in the global Scope using a function? Python 3
def lsum(x): res = [] for i in x: res.append(x+1) L = res L = [1,2,4] lsum(L) print(L) How can I modify the above code without using global L to print("L") "return" [2,3,5]? That is, I want to…
-
1
votes1
answer533
viewsLinkedlist in Java
First of all, I have a Linkedlist called Linkedeventos. LinkedList<Eventos> LinkedEventos = new LinkedList<Eventos>(); Then I have an assignment LinkedEventos = Compra;. Someone can tell…
-
1
votes1
answer18
viewsDisplay a certain vector in a 2D list
I have the following problem: I have a 2D vector and wish to display only the first vector ([250, 27.65863337187866, 93.38094023943002, 27.65863337187866]). I wrote a code, but it’s showing…
-
1
votes1
answer167
viewslist has not been declared
I’m doing the first part of a c++ work on codeblocks and Ubuntu and I’m getting the following errors: 1 - 'list' has not been declared 2 - no matching Function for call to 'No::verifieNo(int&,…
-
1
votes1
answer778
viewsC++ How to remove an element outside the ends of a list
I use the list library and am having trouble removing an element using remove(), or Erase(). With push_back() and push_front() it works, but I need to remove elements that are not at the ends.. I…
-
1
votes2
answers407
viewsHow popular is the list of objects with select(C# and Mysql) results?
string strSQL = "SELECT usuperm.idusuario, usuperm.codfunc, usuperm.perm FROM usuperm INNER JOIN usuarios ON usuarios.idusuario = usuperm.idusuario WHERE usuarios.loginusuario = @loginusuario AND…
-
1
votes1
answer2952
viewsTypeerror: list indices must be integers, not tuple
I have a code that calculates the Euclidean distance between two points. However, when executed it presents the error: "Typeerror: list indices must be integers, not tuple" I don’t know what I’m…
-
1
votes5
answers789
viewsList comprehension with conditional
My goal is to count how many elements of a given list correspond to a condition. To do so, I made the following lines of code: cont = 0 seq = [] max = 10 for x in seq if x == max: cont = cont+1…
-
1
votes1
answer317
viewsHelp with C nested structs
I was creating in C a list and using a struct, after finishing I tried to see what changed with a struct nestled, created two structs basic, one receiving only one value and another receiving this…
-
1
votes2
answers86
viewsCapture list item by index
I have the code: for(int i = 0; i < 99999; i++) { minhaLista.get(i + x); //x é int e possui um valor qualquer } At some point the sum of i + x results in a value greater than the list size. If…
-
1
votes1
answer404
viewsShow user-installed apps only
Good friends, I’m developing an app for the user to share, back up .. from third-party apps. Be able to create a list where shows all the app’s. It turns out that I do not want to appear system…
-
1
votes0
answers67
viewsLists in HTML5
I’m making a video site and wanted to put a page with several videos next to each other, I tried to do creating div by div was right in my resolution but for other resolutions the content passes the…
-
1
votes1
answer393
viewsHow can I move an element from an Arraylist to the last element ?
I would like to know if there is any method to perform the operation, other than to concatenate manually. Example of what you wanted: [1,2,3,4] -> [1,3,4,2]
-
1
votes1
answer255
views -
1
votes2
answers696
viewsCalculate the smallest element of a list
Given a sequence of integers (read via Scanner), determine the lower of these values. My code: import java.util.Scanner; public class MenorValorSequencia { public static void main (String args []) {…
-
1
votes2
answers897
viewsHow to delete an element from an Array String?
I’m having the following build error: del(alimentos[i]) TypeError: 'str' object doesn't support item deletion What did I do wrong? I would like to remove the typed item from the list. My code: dieta…
-
1
votes1
answer1023
viewsHow to print an element from a list each time a given method is called?
I’m trying to make a game of mathematical expressions in python, but I need my Mandaexp method to return an expression every time it’s called. In this method I have a list called explist, where…
-
1
votes2
answers497
viewsConflict of types in function
I’m trying to create a list structure using struct. Only when compiling my code, I get an error because even specifying the type Lista, he’s in some kind of trouble. Follow the full code: #include…
-
1
votes1
answer348
viewsHow do I edit an element of this array?
I have an array this way: List<dynamic> business_list = new List<dynamic>(); business_list.Add(new { business_Name = reader.GetString("name"), business_OwnerID =…
-
1
votes1
answer164
viewsError in dictionary key
I am trying to store dictionaries in a list and then print according to the position in the list, however this giving an error in the key... Code below: nome = "nomedahora" cpf = "1421241"…
-
1
votes1
answer5742
viewsPrint chained list in C
I’m creating a program that receives a vector and creates a chained list. I need help creating the "print()" function, which prints the generated chained list. I don’t know how to proceed. #include…
-
1
votes2
answers6013
viewsPrinting widgets from a list
Is there any way to read the values that are in a list and present them on the console? I tried it like this, but it doesn’t work Console.WriteLine(lista);
-
1
votes1
answer93
viewsHow to list a Graphapi response with React?
I have been trying for days to create a simple list of the names of the events I receive from a request for Graphapi from Facebook. The object I receive is the following: How do I make a list of…
-
1
votes1
answer1630
viewsSequential list implementation exercise
I’m trying to solve this college exercise that I’ve already implemented a lot of, but there are still three things missing. It’s about data structure with Java OO - sequential list. Follow the code…
-
1
votes3
answers11136
viewsStore data inside a Python loop array
Good afternoon, you guys. I’ve been learning a lot of C and C++, and the python part too. It confuses me a lot the syntaxes sometimes, because I often think of C and I get confused in python. In the…
-
1
votes1
answer141
views -
1
votes2
answers2096
viewsFind a string anywhere in the List c#
Good Afternoon. I would like to know how to find a string anywhere in the list. Ex.: string "123". It can be in Pessoa.id, Pessoa.Nome, Endereco.id, Endereco.Rua or Endereco.CEP; People’s List…
-
1
votes1
answer42
viewsChanging list by reference in R
I have the following problem. I have 5 graphs (per hour, it won’t matter the structure of each graph, only that I have 5 graphs) and put them inside a list in R. I will make changes to these graphs…
-
1
votes0
answers467
viewsHow to generate a list with data from an Android Checkbox?
I am developing an Android app for pizzeria that generates a list of ingredients from checked Checkbox, IE, the user gives a "check" in the items you want for your pizza as catupiry, pepperoni,…
-
1
votes2
answers57
views -
1
votes0
answers85
viewshow to put the reminder class on a list;
I’m making an app that will be like a calendar and in it will have a part to save reminders, what I wanted to know is how to put the reminder class in a queue( appear in the queue several different…
-
1
votes1
answer948
viewsHow to add up the values of an index?
I am new in python and need to make a program that add the digits that belong to the same position of a list, for example: Lista = ['22659', '387685', '89546'] The result of the list sum[0] would be…
-
1
votes1
answer395
viewsChained list without head, intersection function problem
I’m doing a series of function with chained list without head, but a function called Intersection is not working properly, the problem compiles without errors but this function specifically does not…
-
1
votes3
answers993
viewsList files in a folder containing a specific word in the name
I’m developing a system in Joomla! and I need to provide specific files for each user (holerite). I have already managed through the session to know which user is logged in. In the Joomla! , I added…
-
1
votes2
answers1032
viewsHow to find the second smallest value of a python array without using built-in functions?
I’m new to programming and I’m having trouble creating a code that returns the second lowest value of a array, ex: array = [2, 3, 6, 6, 5] return 3 I am in that phase of practicing the logic of…
-
1
votes3
answers196
viewsIs it possible to store values without using static vectors?
I need to create a sparse matrix of the cross-dynamic list type and my cells are the type: typedef struct CELULA{ int linha; int coluna; double valor; }CELULA; But every time I create a new cell in…
-
1
votes0
answers216
viewsHow to add a Expandablelistview in Android’s Navigation Drawer menu
I created this Navigation Drawer that already comes in Android Studio itself: However, I wanted to know how I can transform this list of it expandable. I want to put sub-items for each item in the…
-
1
votes1
answer100
viewsBest object-oriented way to solve the problem
Suppose I am modeling a Paycheck. However, each entry in a Paycheck I chose to model as a ItemContracheque. That is, to represent my Paycheck as a whole, I can use a simple list of ItemContracheque.…
-
1
votes0
answers55
viewsRecover chained list of.bin file
I am programming in C and I have a code that uses a sequential list of 50 positions to store in each of its spaces the first address of several chained lists, so far so good, the problem is when I…
-
1
votes2
answers2589
viewsCannot implicity Convert type 'System.Collections.Generic.Ienumerable' to 'System.Collections.Generic.List'
I have the following method below for the purpose of returning notifications that must be displayed to a particular customer and notifications that must be displayed to all customers. public…
-
1
votes2
answers2960
viewsElements in common between lists
How do I compare elements from 2 lists, and return the amount of elements in common ? For example: a=[1, 2, 3, 4, 5] b=[6, 7, 8, 9, 10, 1, 2, 11, 22] This should return 2, because there are only 2…
-
1
votes0
answers13
viewsTo return a list by passing a TVP as parameter
Good afternoon, you guys. I am writing a consultation method and need to pass a list of positions to my Precedent to get a list of employees. I am trying to use a TVP instead of sending a string…
-
1
votes1
answer78
viewsList append on for loop - Swift 3 / Xcode 8
I’m having a problem Adding items to a list Inside the 'for' loop, Where all items in the list are repeated with the last value entered. Here is my Nsmanagedobject list var listCursosNovos: [Cursos]…
-
1
votes2
answers247
viewsHow to sort a list by the number of occurrences? In Python
Like, I have a list like this: lista = [1,1,2,3,3,3] And I want to order her to stay lista = [3,3,3,1,1,2] That is, the most occurring values would be at the beginning of the list, while the least…
-
1
votes1
answer148
viewsHow to create sublists with pairs of elements (x,y), in which the first of them (x) is in a sequence?
Friends, imagine a list of pairs of elements (x,y): lista = [(13, 38), (14, 35), (14, 36), (15, 33), (15, 34), (15, 35), (15, 36), (18, 31), (18, 32), (19, 33), (22, 34), (22, 29), (23, 30), (23,…
-
1
votes2
answers68
viewsExercise list ordering
Good afternoon, I am developing an exercise and in a moment I have to order a list and remove elements repeated, for this I perform the conversion to set and then convert to list again: def…
-
1
votes1
answer949
viewsHow to check the type of elements in a Python list?
I have a list of data, and I need to verify that all elements are integer or string, or any other type of data. It is possible to verify all elements or needs to be one by one? For example: Lista =…
-
1
votes1
answer725
viewsList objects from my Buckets - Amazon S3 SDK PHP
My project is: List my Buckets List the objects of each Bucket I created a foreach to list the Buckets and it worked perfectly. The same thing didn’t happen with the foreach of the objects. $buckets…
-
1
votes0
answers47
viewsHow to create sublists by obeying the cell connection in a matrix
Friends, I am trying to create sublists from a matrix to segment cells that are connected, such as the matrix below: From this matrix I get this list with the painted cells: lista = [[1, 1], [2, 1],…
-
1
votes0
answers29
viewsSubreport with iReport in Java - The supplied java.sql.Connection Object is null
Hello! I’m studying iReport Design and started using Connection in my fillReport. So far, everything was fine. The problem is that, now, I started to use Collection, through the commands:…