Questions tagged as 'lista'

3
answers

Delete duplicate items in a list

I need to find a more efficient way to remove duplicates from a list in Python. I'm doing it this way: for i in mj: if i not in mj2: mj2.append(i) Where kj is a list as [2, 4, 4, 4, 4, 4, 9, 9] and output mj2...
asked by 18.07.2017 / 20:27
3
answers

How to find the most repeated number in a list

I have the following list: [0, 1, 2, 3, 4, 6, 6, 17, 16, 9, 10, 23, 12, 13, 14, 15, 16, 17, 18, 4, 20, 4, 22, 23, 24, 4, 4] I wanted to know how to find the number with the most repetitions without having to use a cycle since I do not see i...
asked by 29.03.2018 / 19:17
3
answers

Instance individual class objects in a list

I try to instantiate several objects of the class Persona , which has three attributes, what should be the correct syntax to be able to instantiate it directly in the constructor of the list of people? // clase persona public class...
asked by 27.10.2017 / 19:45
2
answers

C ++ error no matching function for call to 'Node :: Node (point &, float &, Node &)'

I have an error in the code, precisely in the constructor, the compiler says that I am not passing the appropriate parameters, to put in context, this is the class that the constructor has, I only put the relevant functions to understand the dou...
asked by 20.11.2018 / 00:56
2
answers

Iterate a list and save it in a file

I am trying to iterate a list and then save it to a file .txt with open/write . lista = ['uno', 'dos', 'tres'] mi_path = "../fichero.txt" f = open(mi_path, 'a+') for i in lista: f.write(i) f.close() I give the attribut...
asked by 12.07.2017 / 11:59
6
answers

Remove blank spaces from a series

I have a list of this form, and I need to remove the spaces between words, that is, to make it look like this: 'jul07', 'jul08' ... Here I leave the code: FechasList = [] for i in date: if i not in FechasList:...
asked by 13.07.2017 / 21:58
3
answers

Compare two element-by-element vectors

I have two lists in Python: a = [1, 5, 5] b = [2, 10, 8] If 1 < 2 and 5 < 10 and 5 < 8 , that is, if each element of the list a is less than its corresponding element list b , then the variable c...
asked by 25.07.2017 / 09:33
3
answers

Delete an item from a "list"

Good morning, I am learning to work with C pointers and I have a question about an algorithm that I am implementing that makes extensive use of malloc , realloc and free , this is the code: List.h #ifndef _LIST_H_ #d...
asked by 11.10.2016 / 20:50
1
answer

How to make my program appear in the list of Windows programs?

I have a question, how can I make my program done in Java, come out in the list of programs installed in Windows? Any class that allows me to do this?     
asked by 18.10.2016 / 21:47
5
answers

ListObject to String in Java

I have a List of an Object. public class BusStop { private String description; private float lat; private float lng; //getter and setter } Of which I try to put all its content inside a variable of type String. I tri...
asked by 10.05.2018 / 12:06