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
answer243
viewsHow to change the color of items in a list in Python?
I am beginning to learn Python and have little knowledge in this area. In order to improve my knowledge, I developed an algorithm for a game of dice that I own. It works perfectly. However, I would…
-
-1
votes1
answer155
viewsConverting a list of lists of vectors into a list of matrices - R
I’m working on an environmental model that returns a list of vectors. Each list corresponds to a point in space, and each vector is a time series of data for different variables. I’m trying to…
-
-1
votes2
answers51
viewsProduct between vectors
The user chooses the number of positions of two vectors and makes the product between them and displays in the list the result, the code I made is below v1 = int(input("Digite a quantidade de…
-
-1
votes1
answer34
viewsC# - Connect Gridcontrol with a List and manipulate the records in run-time
all right ??? This is my first question here on stack overflow, I’m sorry if I did anything wrong !!! I’m starting with C# and Devexpress and I’m trying to create an example using Devexpress…
-
-1
votes1
answer46
viewsWhy does the list error Object has in the 'checks' attribute occur?
I’m building a program based on a class diagram, and it appears Attributeerror: 'list' Object has no attribute 'checks' when I print the list with the client’s checks class Cheque: def…
-
-1
votes1
answer263
viewsRead a txt file, insert into an array and display in a textbox in C#
I need to open the txt file with the data already inserted with three columns and separated by ';' and after opening the file I insert it into an Array with List, save the data and need the values…
-
-1
votes1
answer61
viewsHow to know List Size? ANDROID KOTLIN
ANDROID KOTLIN : Next: I have my Data Class with its variables,I make a call to the api and I get in my Adapter the list size to add to my attributes in xml ok.. wanted in Activity I put the amount…
-
-1
votes1
answer58
viewsHow do I alphabetize the Telephonic list that is separated between older and younger?
Before making a Phonebook containing name, phone and age, after capturing the data, I need to separate them into older and younger 18 years and print on the screen the result with all the data…
-
-1
votes1
answer42
viewsConverting total hours of a month into days and hours
Hello! I am working on a data_set in which the time measure is in Total Hours Races of the month. Going from hour 1 to hour 734. I want to convert this measure of time into hours of the month per…
-
-1
votes0
answers15
viewsMount a string with user-delimited size and can be parsed character by character
I need to keep several names (compounds) of different people, so that I can return to the user the first letters of each name, and the last name of each person. That’s what I’ve done so far:…
-
-2
votes1
answer107
viewsProblem when displaying list
I’m using the static type list, and when I try to display it, it just shows the first student of registered. #include <stdio.h> #include <stdlib.h> #define MAX 12 typedef struct Alunos…
-
-2
votes2
answers66
viewsList counting elements
I have a list, like this: L = [0, 0, 1, 1, 1] If you used the command SET: L = [0,1] sum(L) = 2 The answer I need would be: 3. Each pair of answers would be one point, as it has two '0' = 1, one…
-
-2
votes1
answer59
viewsHow to compare numbers in vector list?
I have an integer vector list in java (Arraylist Listvet). public static ArrayList<Integer> ListVet; And I need to make a comparison between two numbers from that same vector list. So, I did…
-
-2
votes1
answer670
viewsHow to add a Textbox dynamically using VB
How to add a Textbox dynamically, whenever the Userform (List Data Combination or Validation Box) is equal to "Outro (Especificar)", using VB ? I’m lost, I’m new to making macros and forms, using…
-
-2
votes2
answers1446
viewsHow to pick up array index?
I have the following APEX code List<integer> entrada = new List<integer>(); public static void generateStringArray(integer entrada){ List<String> ListaPrincipal = new…
-
-2
votes1
answer16467
viewsError: 'int' Object is not subscriptable
In a long jump competition each athlete is entitled to five jumps. The result of the athlete will be determined by the average of the five remaining values. You must make a program that receives the…
-
-2
votes3
answers536
viewsInstanceof with List in JAVA
I have declared a method that receives a List of the kind Object. But when I try to recognize him as instanceof it gives error. I have tried to do a casting but still giving error and could not…
-
-2
votes2
answers93
viewsChecking an element in a list of tuples using the in command, only one parameter observed in python
How to check if a tuple is contained in a list using the property in. Example: lista = [('joao', 13), ('maria', 20), ('carlos', 30)] I want to know if carlos is on the list…
-
-2
votes1
answer28
viewsList With Gigantic Array
The software like output a list with only one giant array: [array([0.000000e+00, 1.687500e-01, 5.062500e-01, ..., 3.616745e+03, 3.617745e+03, 3.618245e+03])] My goal was to get a list, with each…
-
-2
votes1
answer58
viewsI am trying to create a sketch of deleting items from a list. The data that will be deleted is the input() that will determine
objetos = ["1", "2", "3","4", "5", "6"] escolha_cliente = input("ESCOLHA OS ITENS OU DIGITE FIM PARA NAO ESCOLHER NENHUM: ") if escolha_cliente.isdigit(): escolha_cliente =…
-
-2
votes3
answers114
views -
-2
votes1
answer385
viewsCompare lists that are exactly the same
I’m trying to implement a list comparison method that checks if they are equal. It must return true when the two lists passed by parameter are exactly equal (number of elements, elements and…
-
-2
votes1
answer54
viewsGet the lowest value with the map in a Dict
I’m studying the function map() And I was wondering if there’s any way I could retrieve the least value from a dictionary within a list. The way I’m doing I’m only managing to change all values.…
-
-2
votes1
answer46
viewsIs it possible to create dictionaries using surreptitious ties?
I was wondering if I could create a dictionary using loops. But I don’t want to create a dictionary within a list [{ }]. example: from random import randint jog = dict() for n in range(1, 5):…
-
-2
votes1
answer50
viewsHow do I order a Complex List?
How do I sort a complex list ? I have this list below and I need to sort by Nometype and Nomesubtype: public class Tipo() { public int IdTipo {get; set;} public string NomeTipo {get; set;} public…
-
-2
votes1
answer45
viewsError when executing the program hangs. Circular list(Solved) However I’m still in doubt
I have an error that only appears during the execution of the program. I would like someone who has knowledge of why this occurs, can explain to me. #include<stdio.h> #include<stdlib.h>…
-
-2
votes1
answer42
viewsCreate a function that reads a list correctly
This function should ask for a name to be used as a search term. If the search movie is in the list, all data from the movie. Otherwise, a message that is not on the list. This is the function I…
-
-2
votes1
answer92
viewsPYTHON - Fibonacci Sequence Implementation
I’m trying to put the Fibonacci sequence in Python in Vscode, and every time I try to run the following code, the error appears: line 8, in <module> Fibonacci[i] = proximo IndexError: list…
-
-2
votes1
answer44
viewsHow to generate a user-defined list?
I want to create a list where the user sets the amount of items in the list and asks the user for each item in the list. I did it that way: n = int(input("Digite a quantidade de células da sua…
-
-2
votes1
answer38
viewsHow can I remove 'R$ xa0' from a obtained result?
I am collecting data from a particular site, where when collecting some values I am facing some difficulties and would like to help to solve. I have the following code: valores =…
-
-2
votes0
answers28
viewsRecursive function to return largest element in a list
Recursive function that receives a lista and return the highest value from that list. def maior(lista): maior=0 if len(lista)==0: return lista elif len(lista)==1: return lista else: for i in lista:…
-
-2
votes1
answer41
viewsHow to create a class that contains a list of objects of a parent class?
I need to create a person class that will have attributes (name, age) and a group class that will contain a list of objects of the person class. However I do not know how to do the second class...…
-
-2
votes2
answers204
viewsIs there any way to nest one for N times?
In Python is there any way to nest one for inside the other N times? Or is there some kind of algorithm that simulates this? Basically I need to create a function, which performs combinations of…
-
-2
votes1
answer58
viewsArraylist of classes
I have a main class that has auxiliary classes as attributes. Example: Main class MoedasList: public class MoedasList { public USD USD; public USDT USDT; public ARS ARS; } Each attribute is an…
-
-2
votes4
answers87
viewsComparing dictionary values() with list values
I have the following dictionary and a list; from the dictionary I extracted the top 10 values. My question is this: I need to compare the keys of the respective values extracted from the dictMaior…
-
-2
votes1
answer178
viewsProblem when deleting a number from a list!
After drawing a number from a list, I need to delete this number from my list. but the message "list index out of range" appears. My error is in the if line. or is there a better way to delete that…
-
-2
votes1
answer53
viewsHow to make the Join() method work for each word from multiple lists within another list
I had done something like this for the even and odd list for the question asks: read several words (one by one) and concatenate in two (2) texts the words read, as per: TEXT 1: All PAR-Sized Words;…
-
-2
votes1
answer73
viewsCode does not work [PYTHON]
I wrote a simple script that captures student grades through an auxiliary list and then plays everything within a larger list, including the average of students that is calculated during the code. I…
-
-2
votes3
answers347
viewsCreate list with the sum of consecutive equal numbers
That’s my structure, but the if, elif and even the else (although not in the code), they are not working. The code is printing several lines as if they were if'separate s and the function has to add…
-
-2
votes1
answer1094
viewsRead Python Json file (beginner)
Good morning! I’m starting in python and I’m not able to read two specific fields in the generated json, with the following format: [ { "nomeArq": "arquivoA", "dataAnt": "28042020", "dataAtu":…
-
-2
votes1
answer255
viewsHow do I navigate through a Python list for each function call?
I have this code as an example: # 0 1 2 3 4 lista = ['1','2','3','4','5'] def nexxt(): for item in range(len(lista)): item += 1 print(lista[item]) def back(): for item in range(len(lista)): item -=…
-
-2
votes1
answer497
viewsIdentify if a matrix is triangular upper, lower or diagonal
I need to receive a matrix and identify if it is an upper triangular matrix, a lower triangular matrix or a diagonal matrix (upper+lower) I wrote a code initially to find out if it is diagonal…
-
-2
votes2
answers94
viewsHow to make a replacement using the tuple list in python
The question asks for : A buffet restaurant offers only five basic types of food. Think of five simple dishes and store them in a tuple. • Use a for loop to display each dish offered by the…
-
-2
votes1
answer43
viewsIn this program, I wanted it to include in the final list the even numbers of the first list and the odd numbers of the second, why doesn’t this happen?(python)
*In the final list, numbers appear that were not supposed to be there, for example 103, which is an odd number from the first list. lista_1 = [10,24,50,103,30,12] lista_2 = [13, 16, 39, 14, 107, 35]…
-
-2
votes1
answer41
viewsHow to bring the unique values of a list array according to the newest Javascript date
Good afternoon this script only works if my Array is always sorter from oldest to newest date How would you give var dados = [ ["09/01/2020","JOAO"], ["13/01/2020","PAULO"], ["23/01/2020","JOAO"],…
-
-2
votes2
answers114
viewsMost efficient algorithm to find indices of the 2 elements of a list whose sum is equal to a certain value
The Challenge is simple, find two numbers from a given list that if summed result in a specific number and return the index of those numbers. That I solved, the problem is that in addition the…
-
-2
votes1
answer118
viewsListview is not displayed below a 'Container'
I’m new to the flutter and I’m having a hard time showing a Listview below a Container. In the codex lattice below is displayed only mine Container, and the Listview just doesn’t show up. Obs: no…
-
-2
votes1
answer122
viewsA function that takes the names of two files as arguments
Program containing a function that takes the names of two files as arguments. The first file contains student names and the second file contains student grades. In the first file, each line…
-
-2
votes1
answer40
viewsfailed . append attribute when entering list entry - (Python)
I was able to leave my registration in loop that will be terminated only if the user type N or n. After closing the registration the program displays the registration lists and draw list, however,…
-
-2
votes1
answer56
viewsDoubt about finding information in the database
I’m trying to make a simple system of login, would like the system to check the logins that are already registered in the database, so that you have no more than one equal registered. I am using the…