Posts by Breno Nahuz • 97 points
10 posts
-
0
votes1
answer20
viewsQ: Separate database tables to obtain values separately
I have a table with values every month of several years, I would like to separate each year with the respective index calculation for another table or make the queries in this same table, as I would…
sqlasked Breno Nahuz 97 -
0
votes2
answers490
viewsA: How to use the contents of the index in Python?
So it seems your problem can be solved as follows: Lista = ["cachorro","vaca","gato"] for palavra in Lista: temp = palavra #faça o que precisar com a variável temp So regardless of the size of the…
pythonanswered Breno Nahuz 97 -
1
votes3
answers140
viewsQ: How do I place a conditional within a . foreach() in Javascript?
I’m making a Scrapping on a website that organizes items with a tag <a>, however I am getting several values with null. How can I place a parole to avoid these values null on the return? const…
-
1
votes1
answer78
viewsQ: How to iterate inside a list that is inside another class?
I wonder if it is possible to iterate a list that is in another class. On a social network, every user has a list of posts, but this list is defined only in the class User how to iterate inside it ?…
-
1
votes1
answer781
viewsQ: Size of Binary Tree
I need to develop a method to calculate the size of a Binary Tree but I’m getting compiler error. Code: class No: def __init__(self, dado): self.esq = None self.dir = None self.dado = dado class…
-
1
votes1
answer42
viewsQ: Why does this method return me 2?
I have a code to analyze and I’m not sure understand why this method of my Binary Tree returns me 2. Code: class No: def __init__(self, dado): self.esq = None self.dir = None self.dado = dado class…
-
1
votes1
answer820
viewsQ: Binary Tree with In-Order and Pre-order Path
I’m having some doubts about the route taken by this binary tree: Could you classify it as binary? Since it has 3-leaf knots?…
-
1
votes2
answers649
viewsA: Recursion in Python 3
I was able to analyze the error. The recursion would go to infinity because it would not call the formula again. For curious, the correct code below: def seq1(n): if n >= 1: if n == 1: return…
-
1
votes2
answers649
viewsQ: Recursion in Python 3
I’m having trouble organizing a recursive summation formula in Python. I need to calculate: My code: def seq1(n): if n == 1: return n return seq1(n-1)+(-1**(n+1)/n) I keep getting the same error for…
-
1
votes1
answer785
viewsQ: Remove duplicate elements from a python chained list
My code returns error when trying to run: class No: def __init__(self,inidado): self.dado = inidado self.proximo = None def pegaDado(self): return self.dado def pegaProximo(self): return…