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
answer58
viewsProblem on the list
The list should insert the fields of struct trucks and then print them.But when I ask to print, only the first insertion appears. #include <stdio.h> #include <stdlib.h> #include…
-
-1
votes1
answer178
viewsSort an alphanumeric list by number
For study purposes, I have the following problem: A list with grocery shopping with description and values , I need to order increasingly but without losing the description. Note: To order the items…
-
-1
votes2
answers3552
viewsAdd values to a C#list
Hi! I am reading values from a table and inserting them into a list. What I have is this: Expiração.Add(rdr["Name" + "Address"].ToString()); Expiração.Add(rdr["Address"].ToString());…
-
-1
votes1
answer46
viewsEdit a list that is inside another list
I need to split the list inside another list. lista = [ [Temperatura final = 250 k], [Temperatura Minima = 120 k], [Temperatura Maxima = 310 k] ] Get the final result listafinal = [ [Temperatura…
-
-1
votes1
answer90
viewsHow do you order the list, no repeat numbers?
I was given this list to sort without repeating numbers. What would be the best way to do? lst = [54,54,93,93,77,77,44,44] def bubbleSort(lst1): for x in range(len(lst1)-2,0,-3): for y in range(x):…
-
-1
votes1
answer66
viewsHelp with multiple Selenium Python Ivs
Friends, can you help me? I want to make web Scrap from a page and return all 8 texts from a span.text-Ellipsis. I made the following code: self.otherPlayers =…
-
-1
votes1
answer216
viewsPython sort list of dictionaries by key and value in separate orders
How to sort a list of dictionaries for example: nomes = [{'nome': 'joao', 'sobrenome' 'alves'},{'nome': 'joao', 'sobrenome' 'silva'}] In alphabetical order the names In reverse order, surnames that…
-
-1
votes1
answer2736
viewsAdd rows and columns in R
Good morning, I have been using R for a short time and have been learning in practice. I have now come across a difficulty with a table. How can I add all rows of certain columns and display the…
-
-1
votes1
answer45
viewsSelecting Python String List Cell
I have to select only the last sentence containing 'M6C13'. The text with all sentences in full is in this string path variable that receives the text through the CMD: path =…
-
-1
votes1
answer33
viewsAdd more than one identical key to a table
A problem arose in an excerpt of the code, where it is stored in a variable Hashmap 2 different values, the problem is that the indexing as I understand it is done by the key, that is, it is not…
-
-1
votes2
answers586
viewsHow to count repeated elements in a list of tuples?
listaAnimais=[('leao', 'Simba'), ('javali', 'Pumba'), ('leao', 'Scar'), ('hiena', 'Banzai'), ('leao', 'Mufasa')] #especie,nome dicEspecies={} for especies,nome in listaAnimais:…
-
-1
votes1
answer456
viewsTraverse attributes of an object that is in a list in C#
Good night, I need help please. I am writing a program that reads a file. For each line of the file an object is created. Each object is stored in a list. My intention is, when loading the initial…
-
-1
votes1
answer237
viewsConverting list to float array
I am working on an import of data, which are in format, as in the example: [-2.814285863362681, -2.814158589901394, -2.8123844084634873] [-2.874285863362681, -2.054158589901394, -2.6523844084634873]…
-
-1
votes1
answer294
viewspython - Print the list elements ending with the letter 'a'
Considering the following list: lista_nomes =['Manuel', 'Laura', 'Antonio', 'Jasmim', 'Maria', 'Silvia', 'Lu', 'Pancrácio', 'Diogo', 'Ricardo', 'Miguel', 'Andre',]* What I want is to print out the…
-
-1
votes4
answers1516
viewshow it returns the indices of a python list
I have the list: lista = [0,0,0,0] How can I return the contents of this list so it stays that way: Índice: 0 1 2 3 item: 0 0 0 0 def f1(): #funcão criar um post, cria um novo post com 0 likes…
-
-1
votes2
answers66
viewsReceive items from an ordered list in a variable - Python
Good afternoon, you guys! I started studying Python recently, and I have a question that may seem basic but it’s complicating me. I wanted to receive the items of a list in an ordered form variable.…
-
-1
votes1
answer62
viewsExit "while" by filling lists
I need to make a code that uses while and lists, which aims the user to register an undetermined number of people while he wants and put 0 to finish and show on the screen the created list. It is…
-
-1
votes1
answer115
viewsSplit subdictionaries in python
Good guys, I created a ICT, and I divided it using the function: listOfDicts = [{k:v for k,v in dictionary.items() if k%10==i} for i in range(10)] From that, I got 10 sublists: listOfDicts[0 a 9]…
-
-1
votes1
answer42
viewsHow to assign the result of a while/for to a list so it can operate with the values
n = int(input("what range?")) f1=0 f2=1 cont = 1 while cont <= n: f3 = f1 + f2 f1 = f2 f2 = f3 if f3 % 2 == 0: print(f3) # Como eu somo os valores de f3 ou transformo ele em uma lista? cont += 1…
-
-1
votes2
answers502
viewsAssociating positions with Python elements
Make a program that reads two lists with 10 elements each and calculate another list containing at even positions the values of the first and at odd positions the values of the second. Please help…
-
-1
votes1
answer168
viewsHow to compare two lists of names in python?
Hello, all right? So I have two lists in pdf and I would like to get the names of the people who are on both lists. How would you do this in python? It would be better in another language?…
-
-1
votes2
answers284
viewsConvert pandas dataframe column with string array (Python)
I have a data frame pandas in Python, in which one of the columns is bringing the values in an array(list). I would like to remove the brackets ([]), to convert into string. I have tried with strip,…
-
-1
votes2
answers130
viewsShow Python words with 04 letters only
I’m learning Python and I’m doing an exercise, which is this one: Implement a program that asks the user for a list of words (i.e., strings) and then display on the screen, one per line, all…
-
-1
votes1
answer254
viewsMulti-entry loop for list - Python
I have a list of several tuples inside, and within tuples various elements. I need to scan all tuples on the list to capture an element that is inside each of these tuples. How can I do this? The…
-
-1
votes1
answer39
viewslist with values greater than those reported by the user
I need a program that prints a list with values greater than the one informed by the user, and these values that need to be printed by the list are in a function already defined. My code: import…
-
-1
votes1
answer112
viewsHow to deal with the null values of an array when converting from String to Double?
I need to display the top 10 contract termination clauses, which are in a vector, extracted from a CSV file. Here, when I refer to contract termination clauses, I mean monetary values (money), more…
-
-1
votes1
answer52
viewsBreak a list and create lists
hello! I have the following list in python of numbers: ['1','2','1','2','3','4','1','2','3','4','5','6','7','1','2','3','4','5','6','7'] And I want to break that list and create other lists in such…
-
-1
votes1
answer50
viewsC# Lambda function with multiple validations, checking using contains with multiple comparisons
_release is a List with several records x.located is a bool x.Description is a string I’m trying this way if (_lancamento.Where(x => x.Localizado && x.descricao.Contains(new…
-
-1
votes3
answers174
viewsPython - Sine cycle in degrees
Good in order to calculate the sine cycle (sin) in degrees between 0 and 390 with an interval of 10. print('Ciclo seno em graus entre 0 e 390 com intervalo de 10') a=0 while True: if…
-
-1
votes1
answer55
viewsProblem with Double Chained List
My function - for now - can create a list and add items at the beginning or end of the list. But when calling the add item function, selecting 1 or 2, and entering the item, the program simply…
-
-1
votes1
answer55
viewsError adding to a List in JAVA
I am trying to add a value to a list but am getting the following error: Cannot invoke "java.util.List.add(Object)" because "[]" is null The code is this: static void montaEl(int tam, Elemento el) {…
-
-1
votes1
answer733
viewsError to recover a Future List<Class> Dart
People are having trouble recovering data from a future function when arriving in snapshot... presents this error: AsyncSnapshot<List<Episodio>>(ConnectionState.done, null, Exception:…
-
-1
votes2
answers60
viewsSimply Chained List in C - Do not compile correctly
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <locale.h> typedef struct nodo Nodo; struct nodo{ int valor; Nodo *proximo; }; void cria_lista(Nodo…
-
-1
votes1
answer963
viewsShuffle text
insira o código aqui[![inserir a descrição da imagem aqui][1]][1] shuffle text Rules: 1. Punctuation marks are word separators, are not part of words and so are not shuffled, for example: a)…
-
-1
votes1
answer275
viewsConcatenate two sequential static lists
I’m having trouble making a function that receives two lists and returns a third with the elements of the first concatenated with the elements of the second. I made the code but it returns me the…
-
-1
votes1
answer63
viewsFinite looping
I am transcribing from Java to Python a code to solve a Sudoku 4/4. When I test the code it doesn’t run and runs endlessly, apparently in one of the methods of the Artist class. Can someone help me…
-
-1
votes1
answer327
viewsChanging characters from a python message
I want to make a program that encrypts a message by the polar Zenit method, which consists of exchanging these letters among themselves, changing the text without the use of accents. I can already…
-
-1
votes1
answer68
viewsI am unable to print the notes, which would be n1 and N2 of the list, I do not know if the parameter sent to the function is correct
#include <stdio.h> #include <stdlib.h> typedef struct nota n; struct nota { float n1; float n2; float mf; struct nota…
-
-1
votes1
answer1105
viewsImage does not appear in Flatlist React Native
Hello, I’m trying to put together a list with some elements inside it but the image element does not appear but returns the right image size. I created an array with the data I want to show, then…
-
-1
votes1
answer47
viewsPYTHON error index out of range
There I was trying to create a script that did permutation, create a combination of the list items in a new list. Follow the python code: itens = [] while True: adition = input('Coloque os itens: ')…
-
-1
votes2
answers613
viewsAlign icons and text in a list
I’m using the fontawesome to put some icons in a web project I’m doing and I needed to add a <ul>, And on that list, there’s going to be icones and in front of a writing, I’d like those…
-
-1
votes2
answers69
viewsIterations in a tuple list
Good afternoon, I have the following problem: I have a list of tuples called list_chromosomes, with 10 positions. I want to open a new position at the end of it (11th position), where it will…
-
-1
votes2
answers96
viewsPython loop requesting data reentry
I have a problem in my Python code, it is giving loop. Every time I have to insert the list again to show the results. Could someone help me? Follows the code: import numpy as np import pandas as pd…
-
-1
votes1
answer24
viewsCheck between excel and windows lists
good afternoon. I’m developing a program that has 3 stages: 1st Stage: Read a certain directory on Windows that contains multiple subfolders and return me a listing with the name of all the files…
-
-1
votes2
answers52
viewsI’m not finding the highest value in a list with random values
I need to find the highest value in a list of 50 random numbers. To generate these numbers, I used the functions sample and randint. So to generate the list I use: lista = [sample(range(0, 200),…
-
-1
votes1
answer68
views -
-1
votes1
answer98
viewsFunction returning only one value
I am making a program in Python and need to implement a function. The function receives as input two parameters: A dictionary containing as key the name of an employee and as value a list containing…
-
-1
votes1
answer80
viewsRemove characters from python lists
Hello I have a code that le two files one txt and a XML and then checks a string inside a list THE XML: <nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="4.00"> <NFe…
-
-1
votes1
answer60
viewsChecking for data inside a list of lists
I have a list of lists. So: lista = [['2746', '8512.20.21', '2 - Estrangeira - Adquirida no mercado interno, exceto a indicada no código 7', 'SL-121410', '6949999876781'],['2747', '8512.20.21', '2 -…
-
-1
votes1
answer114
viewsHow to add elements from two array lists with if C++
Well, I’ve been stuck on this show for a long time. I am inciante and the purpose of the question is to make operations between each element of two lists if the rest is 1, 2 and so on. Example: 2…