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
-
-2
votes2
answers70
viewsPython - Checking items in a list
I have a scenario, a little confused to explain... but I’ll try... I need to compare listA with listaB, where case 1 or more items from listaA are within the listaB, I print it on the screen, but in…
-
-2
votes1
answer19
viewsHow to Browse a List With Map and Array List Within the Same List (JAVA)Springboot
I need to go through this List (List) however I cannot, I need to pass the value "options",take the value "option_Id", and go through the option_value and bring the option_value_id and Name in…
-
-2
votes1
answer76
viewsProgram problem that traverses two lists and generates a third without repeating elements
For a little over a week I’ve been trying to solve the following exercise: "Make a program that traverses two lists and generates a third without repeating elements." The statement in question is…
-
-3
votes1
answer691
viewsWhile listed in python
Could someone help with the following doubt? in "item", the goal is to loop from 0 to 50 id_rec = [conteudo['complainResult']['complains']['data'][item]['id']] I made the following code: item = 0…
-
-3
votes2
answers53
viewsPrinting lists
Could someone explain why the list of the following code is not printed? Thanks! def produtos_pedidos(produtos): lista = [] while True: pedido = input("Qual produto você quer pedir? Para encerrar o…
-
-3
votes4
answers573
viewshow to create a list of multiples of numbers of 3, from another list of numbers?
meus_numeros = [1, 56, 342, 12, 781, 23, 43, 45, 123, 567] for c in meus_numeros: if c%3 == 0: print(c, end='') File "<ipython-input-12-2b3fd4ceddad>",…
-
-3
votes2
answers64
viewsBug when adding elements to the list and transforming it into a string
I’m trying to headache in the course of a mini-project to develop a hangman game, in the function that would return the string containing the hidden word, showing only the guessed letters. I’ve…
-
-3
votes1
answer33
viewsHow to concatenate two types of different values but of the same input into a list in python?
I have the following code that reads a person’s name and age: pessoas = [] p = [str(input('Digite o nome e a idade da pessoa no formato: "Nome 23": '))] pessoas.append(p) print(pessoas) Supposing I…
-
-3
votes1
answer38
viewsPYTHON - How to create a list containing each element from a previous list within another list
I think the easiest way to describe the problem is to show the goal, otherwise it gets confused. I need to turn something like this: [['3 -1 2 0 2 0 -1 -1', '4 2 4 5 1 0 0 1 1'], ['6 -8 -8 15 15 0',…
-
-3
votes1
answer98
viewsProblems with Matrices - Python 3
1 - Read a matrix D 5 x 5 (consider that duplicate values will not be reported). Then read an X number and write a message indicating whether the value of X exists or NOT in the matrix. 2 - DESAFIO…
-
-3
votes1
answer38
viewsHow to duplicate a struct in "C"
I have an activity that is to create a struct with SIZE = 5 initially, but I would like it to double its value if it is necessary to insert a sixth value, created a return function for this but the…
-
-3
votes1
answer87
viewsPython - List sorting without Sort()
I was studying this list ordering code and there are some things I didn’t understand: Why is it necessary to break? Why leave the else ident with the if and without the break doesn’t work? Why with…
-
-3
votes1
answer1234
viewsCreation of two dictionaries from a dictionary with one criterion
Read and store in a dictionary the name, age and phone number of your contacts, the key being the name. When typing an empty string for the name, the program stops reading and closes. Display the…
-
-4
votes1
answer94
viewsJava List Algorithm - Remove music from playlist
I need to create a java playlist algorithm that removes music from a playlist, I already have the forward, back, random and play buttons; I need to remove music from the playlist with a playlist…
-
-4
votes1
answer306
viewsList count without repeating print - Python
I’m solving a college list, but I can’t find a way to show the numbers count without repeating the print. For example, when the number is repeated I want to print only once and I am not able to do…
-
-4
votes2
answers71
viewsPython rounding list
a = [1.2,2.3,3.4] b = [4.1,5.2,6.3] x = 3.4 y = a.index(x) print (y) y1 = b[y] print (y1) As I would in the code if x were 3. and I wanted to show the nearest value. in the case if x = 3, y would…
-
-4
votes2
answers54
viewsCan someone help me subtract one list from another?
I know it’s simple but I’m beating myself here to do this, I’d like to do a list subtraction in the following way lista_inicio = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "J", "Q", "K", "A"]…
-
-4
votes1
answer45
viewsTransform a simply chained list code into a dual chained java list
I would like you to help me because I am not yet very familiar with double-chained lists.
-
-4
votes3
answers101
viewsRules in python list creation
Good afternoon, I need to follow some rules when generating my list. Are these: 1.Have at least one repeated value 2.Have at least 6 unique values 3.All the numbers cannot be repeated How can I do…
-
-4
votes1
answer54
viewsDoubt how to reverse values in a statistic list in C
Hi, I’m having second thoughts about a university paper on how to reverse a sequence of numbers into a static list in C. The specific part I’m doubting is : **int SList_reverse(SList* lista, int…
-
-5
votes3
answers71
viewsAlgebraic System - Python
Hello, I need to do an activity to solve lower triangular systems of n unknown and n independent terms. NOTE: none of the functions can have print inside them, and I can’t use the Matrix or numpy…
-
-5
votes2
answers80
viewsHow do I check which items in List2 are in List1, then their count and order
I am a beginner in Python and I would like to count on your help for the problems below. I have worked on two lists as the following objectives: 1.Check which items in List2 are in List1 2.Count…