Posts by Juliano • 102 points
11 posts
-
0
votes2
answers456
viewsA: Draw triangle with repetition structure in Python
Hello, At first it may seem a little complex, but just use 2 Python list methods to help you. What you need to do is create a list by filling it with the dots '.' The 2 methods that will help you…
-
0
votes1
answer27
viewsA: Return on value
Instead of receiving calc_cut as parameter, you can declare it within the weight_calculus method: # Como o método aproveitamento retorna o calc_corte, voce pode fazer isso def calculo_peso(self):…
python-3.xanswered Juliano 102 -
0
votes2
answers1401
viewsA: Installation libraries jupyter notebook
Two possible problems: The * you are using. The correct is this way: import pandas as pd If * is just a typo or is only on the return of the error, you need to install the library. Open Anaconda…
-
1
votes1
answer113
viewsA: Python hangman
You can enter something in the Hits list to fill it, like 0 until you reach the quantity Len(Chosen Name). Using Edward as an example that has 6 letters: [0, 0, 0, 0, 0, 0], so you can use a for to…
-
2
votes2
answers240
viewsA: Vector union in Python
You have created an empty list (or vector), aux2. And you are checking (if not in) on this empty list (and you do not add anything during the function). Since you cannot use the functions in the…
-
1
votes2
answers50
viewsA: Strange error in For in Python
Because you use +1 inside the brackets, when i do for arrives at the last position, it tries to access a non-existent position. Either you range between -1 and Len(a)-1 or remove +1 If you want to…
-
1
votes1
answer146
viewsA: send the value of a variable from one program to another - python
You can import the function by doing: main file from nomeDoOutroArquivoSemExtensão import setup_init # Caso queira importar somente a variavel a, basta fazer from nomeDoOutroArquivoSemExtensão…
-
1
votes0
answers61
viewsQ: Ancestors in Prolog
Hello, I need to create a predicate that will return all the ancestors of a person. The point is that I can only pass one parameter to that function. ancestor(Y, X) :- parent(Y, X). ancestor(X) :-…
-
0
votes3
answers121
viewsA: Python - Spaces appear out of thin air when printing print()
Hello, your strings have space at the beginning and at the end. For example: ' car ' Just remove. It would look like this: 'car' I believe that’s the problem.
-
0
votes2
answers238
viewsA: manipulating csv file
Python has pandas which is a very useful library, mainly for handling large files. Example: import pandas as pd # Cria-se uma DataFrame para receber o arquivo # Pode se passar mais parametros como a…
-
1
votes1
answer298
views