Posts by barrosfilho_ • 81 points
6 posts
-
1
votes1
answer1167
viewsQ: Creation of python Dict
Time, has a class that creates dicts and stores them in a list slot: class Pagina: def __init__(self, keys, palavras, tamanhoP): aux = list(zip(keys, palavras)) self.paginas = list() for i in…
-
0
votes1
answer74
viewsQ: Format an object print
Time, I need to format the print of the following class: class Tupla: def __init__(self, keys, palavras): self.keys = list(keys) self.palavras = list(palavras) self.op = dict(zip(self.keys,…
-
-2
votes1
answer108
viewsQ: Print np.array, formatting
Full class: class Tupla: def __init__(self, keys, palavras): self.keys = list(keys) self.palavras = list(palavras) self.op = dict(zip(self.keys, self.palavras)) def __getitem__(self, key): return…
-
1
votes1
answer370
viewsQ: Create sublists in python
I created the following code: self.buckets = [[], []] for i in self.keys: for ii in self.lista: if i % len(lista) == ii: self.buckets[ii].append(i) That adds the elements of a list in the case…
-
0
votes1
answer24
viewsQ: How to split the instance of a class through outrw
To be more precise, yesterday I opened a question asking for help in creating a class that acted as a creator of dictionaries, and promptly I was answered, follows the class: ` class tuplas: def…
-
2
votes2
answers684
viewsQ: Transform object to Dict in python
Good team, blz ? So, I started to study python now and wanted a help from you on the following question: I need a class that receives two distinct arrays (words and key) and relates all elements of…