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
-
0
votes1
answer262
viewsI need help creating a game like 21
I am working on a game type 21, and I am struggling to create a logic so that the values that the user receives through a draw with random.choice are stored in a list and soon after I display the…
-
0
votes1
answer225
viewsUpdate Recyclerview does not update the item in the list
I have a simple recyclerView and Adapter below where I do the CRUD before saving in BD, and everything works except the update, where I update the item by Adapter but the view in the list does not…
-
0
votes1
answer54
viewsData listing with Laravel
Good night devs! I need some strength! Here’s the thing. I am developing an application using the framework. I have the following models: design and functionality The business rule of the…
-
0
votes1
answer118
viewsTypeerror: fetchall() takes in Arguments (1 Given)
When running the code below I get the title error, I tried to use a different code structure by assigning the results of select to a ma variable, tried tbm just bring a bank line with fetchone() and…
-
0
votes2
answers102
viewsrotate a "for" loop with 5 variables together
Use a program to create audio files called stem which combines vocals, drums, melody, bass and an audio guide into a single file. I am trying to create a loop that stores these files and so the…
-
0
votes1
answer304
viewsAdd a new object in a list in another class
I populated a list of dishes from a restaurant, after that, I added a function for the user to create a new dish when they want. However, in the method to create the new dish, I cannot add to the…
-
0
votes1
answer52
views -
0
votes0
answers41
viewsHow to create a single file that stores the details of the generated information (order)?
have_discount = [] no_discount = [] for each_price in purchases_prices: b = bool_gen(p) if b: have_discount.append(apply_discount(each_price,b)) have_discount = [round(each_price, 2) for each_price…
-
0
votes0
answers99
viewsQuestion 22. Python Wiki List BR. Repetition Structure Exercises
Ex. 21: Make a program that asks for an integer number and determines whether or not it is a prime number. Reply BY: HUGO KOTSUBO. Link: https://www.guj.com.br/t/numeros-primos/351814 Ex. 22: Change…
-
0
votes2
answers266
viewsReceive two numbers, add the pairs and multiply the odd
The program should receive two numbers, and then add all pairs between the received range, and multiply all the odd numbers of the received range (including those typed, always). Must be used for or…
-
0
votes1
answer34
viewsHow to print a dynamic list in c++?
Good evening! is my first post here so please in case I reported something wrong, feel free to fix it. I made a dynamic char list, but I’m having difficulty printing the entire list on the screen,…
-
0
votes2
answers63
viewsHow do you compare an item with all other items in the same list (with dictionaries inside) in a pythonic way?
I’m a beginner, guys. Just for the record! I am trying to compare the items on a list with dictionaries and if they are equal, add these items. I think with one example, the idea becomes clearer:…
-
0
votes1
answer64
viewsfind a word in a random character list
I need help in this python exercise Marlon likes to cut letters from his magazines, then reorganize them to form sentences. Once, he cut out the letters ZEPUAMAOIZ and realized that changing the…
-
0
votes1
answer81
viewsSimply Chained List - delete the first half of the list
Good afternoon, you guys. I hope I’m publishing it right, because I’m new to the forum and new to programming. So, on a question that I am, more specifically in "Simple Chained Lists", is that the…
-
0
votes1
answer328
viewsFlutter / Changing a Dropdown List after pressing a button
Good afternoon/night, I’m developing an application where on one of the screens I want to make a "chat" equal to Whatsapp. In terms of functionality, my chat differs from Whatsapp for being totally…
-
0
votes0
answers23
viewsPredicate with a list of 2 values matching pairs
Hello, everyone. I have an SQL with filter that the user has the possibility to inform several "cost centers" and "cost sub-centers" combined. That is, in practice, it would be a list with 2 values…
-
0
votes0
answers46
viewsSearch for elements in tuples within a list
I made this code to search for an event, initially, I was unable to make the method print_events work, now it works, needs adjustments and improvements still and make work the formatting methods, if…
-
0
votes0
answers28
viewsRecursive List with depth count
I created a code to organize a recursive list of categories to print as follows: category 1 -- category 1.1 category 2 -- category 2.2 --- category 2.2.1 json file of data : const data = {…
-
0
votes0
answers47
viewsIn Python, how to delete " n" from . txt files?
I’m at Jupyter Notebook working with Python. I am importing the txt files with the following code: allLines = [] path = '../data/txt/' fileList = os.listdir(path) for i in fileList: file =…
-
0
votes0
answers24
viewshow to join 2 lists in a third list?
what I wanted is a third list to receive the content of the other two but putting together and on the same list, like: a = [1, 2, 3] b = ['ola, mundo', 'oi'] c = [[1, 2, 3, 'ola, mundo', 'oi'], [],…
-
0
votes2
answers60
viewsHow to add the rest of the division to the last Value of a dictionary?
I have the total of a purchase list and need to divide this total by the amount of emails which I have on my second list and return a dictionary. However, not all division is exact, so I need to add…
-
0
votes2
answers78
viewsHow to create a dynamic selectable list on an object in Unity?
I would like to create a list that would appear when the user clicks a button. The list would show the information contained in the database, and the user would select which one would give…
-
0
votes2
answers25
viewsHow to instantiate a class with predefined and immutable parameters C#
How to instantiate this class jogo? public class Jogo { public string Name { get; set; } public string Genre { get; } public string Plataform { get; } public Jogo(string name, string genre, string…
-
0
votes2
answers88
viewshow to correctly pass the txt file data to a python list?
I am creating a simple program that reads data from a file .txt, passing them to a list. Then the program asks for a keyword to check if it exists in the list and show which position it is in. A…
-
0
votes0
answers14
viewsTraverse a BD with Strings and compare with a Char variable
So person is as follows, I’m creating a program to perform the reading of vehicular plates, through OCR and PDI I can already extract a Char from the image ex: 'ABC 1234', and now I need to go…
-
0
votes1
answer53
viewsBring bank result and put in a list to use with variables
I’m working with Python 3.7. I am trying to define variables with data from a list[], the values of the list[] is a result coming from the database, but is giving error. Code: conn =…
-
0
votes1
answer66
viewsFilter a header inside df in pandas
I’m new to pandas and I’m having a hard time. I need to filter the columns in my dataframe, check if they are in a defined list and, if they are, group the columns and add up the values. It sounds…
-
0
votes1
answer88
viewsHow to compare 2 lists and return another list with equal elements? - Haskell
My code is this comparar :: [Int] -> [Int] -> [Int] comparar [] [] = [] comparar (a:as) (b:bs) = [x | x <- as, x == b] ++ [x | x <- bs, x == a] What’s wrong with the code above?…
-
0
votes1
answer30
viewshow to include letters in my list in python and inform the user that it has been repeated
for letra in palavra_secreta: #print(inclui_Letras) if (chute == letra): letras_acertadas[index] = letra inclui_Letras.append(letra) # incluir o 'chute' na list 'inclui_letras print(palavra_secreta,…
-
0
votes1
answer371
viewsHow to simulate Stack with chained list in C?
I’m trying to create a program that checks a certain sequence and returns whether it is well formed or poorly formed. I’d like to make the chained list behave like a pile, but I’m having trouble…
-
0
votes1
answer200
viewsCreate a contact list and separate it into two other lists
I have to create a list of contacts in Python, with name, age and phone number, and then I have to separate in 2 lists: a list only with contacts over 18 years old and another list only under 18…
-
0
votes0
answers20
viewsAutomation of IE VBA drop-down list I need to select an option
Hello guys I am performing a process of automating a site, more when I arrive at an option, it opens others that I can not select. I am using this code "objIE.document.getElementById("img1.0_p").…
-
0
votes3
answers84
viewsCopy between strings inside Python lists
The operation consists of comparing two lists of strings, detecting which items are common and placing them in a certain order in a new list. The closest I got was: nova = [] lista = ['a', 'b', 'c',…
-
0
votes2
answers59
viewsCreate Dataframe from lists with different sizes, keeping the data matching
I have lists of different lengths with data extracted from a PDF. Each value and code is part (is inside) of a respective note: cliente = ['12345','15432'] nota = ['21/0576750-3', '20/063859-1']…
-
0
votes2
answers65
viewsHow to search a list item and return in a message?
I’m starting programming, and I’m doing a bot on Discord using python (Discord.py) I need to create a command for the bot to return the availability of fruit within the list. class…
-
0
votes1
answer11
viewsPrevent users from connecting to the Sharepoint list using excel
I have a list in Sharepoint that I use to insert and edit records via Powerapps, and the App controls what records the user can access. To prevent the user from accessing directly to the list in…
-
0
votes1
answer24
viewsHow to check if a phrase/string contains words from a list in Kotlin
I’m having trouble with the operator in, when I have only one operating i can easily verify if a certain word is contained in a list, for example: fun main(){ val cores = listOf( "branco", "azul",…
-
0
votes0
answers44
viewsremove numbers from a list
I’m solving a question where I need to insert 5 values in a list, add all the numbers in that list and take out their arithmetic media, then I need to remove from the list all the numbers that are…
-
0
votes1
answer45
viewsList Deletion and Return
Will be passed as entry list with the current information of a contact, and the phone you want to delete: • if the phone is in the contact’s phone list, it must be removed. • if not, no update will…
-
0
votes1
answer54
viewspython, list logic - remove item
I’m developing a game based on zombie Dice, in Python. I’m having trouble with the use of the list specifically copo[] , where I need to remove the played dice and then put them back into the game…
-
-1
votes2
answers727
viewsHow do I add the elements of a List<string> to a listbox?
I have a List in a class, and in the main class I want to take this List and add its elements to a listbox and then display them. How do I do this? Thank you!!
-
-1
votes1
answer1019
viewsSelenium getattribute list c#
I’m having a problem creating a list with attributes follows HTML code: <div class="post clearfix" data-post-id="92842173">...</div> <div class="post clearfix"…
-
-1
votes1
answer81
viewsHow to create a list of locked programs in C#?
I want that when selecting one of the programs from the list of programs installed in Windows, it can be blocked. I want to stop them from being opened, in case, with a password. For example,…
-
-1
votes1
answer528
views -
-1
votes1
answer93
viewsWhy does the following code not work?
The code should receive a number of student grades, print the grade average and how many grades are 10% below and 10% above average. The code is like this: quantidade = int(raw_input()) inicio = 0…
-
-1
votes1
answer147
viewsDynamic List with void pointer insert at start
t_lista* Cria_Lista(int (*ptrFncEscreve)(void *ptrElemento)) { t_lista *Lista; Lista = (t_lista*) malloc (sizeof(t_lista)); Lista->qtde = 0; Lista->ptrFncEscreve = EscreveInteiro; return…
-
-1
votes1
answer691
viewsRemoving elements from a Python list
Basically I want to remove the elements from a list by one criterion. For example: I have a room with N students, I will store the grade of these students in a list and compare these grades with the…
-
-1
votes1
answer446
viewsC# Transpose Columns in rows
In C# - Linq: I have a List of objects: Field 1 | Field 2 | Field 3 | Field 4 | Field 5 | Test | 15 | 20 | 45 | 52 | I need to transpose this line from a collection to an integer list 15 20 45 52…
-
-1
votes1
answer43
viewsJoin lists without repeating
I have two lists: . I wanted a way to join the two lists randomly without repeating letters and numbers in the same letter in C#, for example:…
-
-1
votes1
answer453
viewsHow to read an integer with no limit of digits in C
It has some way of reading an integer from the keyboard without limit control of digits. Like I need to pass a giant number via keyboard to a variable and then pass all the digits of that number to…