Posts by Eduardo • 415 points
14 posts
-
0
votes0
answers23
viewsQ: What does the asterisk next to a letter in the vector argument, why this in the code?
What about you guys? , I’m studying about vectors with the pygame python library and I don’t understand why an asterisk next to the letter A in the vector defined in the position variable down in…
python-3.xasked Eduardo 415 -
2
votes1
answer608
viewsQ: What does the class name mean in super(). __init__()?
How the name of the classes inserted within the constructor’s parentheses works __init__( ), in the classes Telefones, TiposTelefone and Agenda? This is only an excerpt of Chapter 10 code from the…
-
0
votes1
answer82
viewsQ: I didn’t understand how the (self) value works in "city.state = self " within the add_city() function
class Estado: def __init__(self, nome, sigla): self.nome = nome self.sigla = sigla self.cidades = [] def adiciona_cidade(self, cidade): #essa linha abaixo que eu não entendi o que significa…
-
2
votes1
answer259
viewsQ: Calculate occurrences in the overlapping string
would like to know how to make how many substring combinations is possible within a string, ex: string = 'abcdcdc' sub_string = 'cdc' the returned value I want in this case, is 2, because the code…
-
1
votes2
answers1032
viewsQ: How to find the second smallest value of a python array without using built-in functions?
I’m new to programming and I’m having trouble creating a code that returns the second lowest value of a array, ex: array = [2, 3, 6, 6, 5] return 3 I am in that phase of practicing the logic of…
-
1
votes1
answer31
viewsQ: Pq shows this strange result when printing the values defined in class ? (Python)
Guys, I created this class (Car class), then defined the values for each argument of this class. Only when printing the variable with the values already defined, this appears: #isso é o que aparece…
-
5
votes2
answers801
viewsQ: parameter master=None inside the class in module Tkinter (python)
I’m learning the Tkinter module in the course of Professor Neri Neitzke, No, I don’t understand what the parameter is for ( master=None ) no __init__(self, master=None) of the class below, could…
-
8
votes4
answers5555
viewsQ: Determine the nth Fibonacci term with recursion
I don’t understand anything about recursive functions, even debugging, is very confusing for me. Someone can explain me in an easy way? I tried to analyze the following code: #!/usr/bin/python def…
-
1
votes1
answer725
viewsQ: How this recursive function (factorial function) behaves in Python
I don’t understand how the code behaves after it leaves the recursive function on line 7, fat = n * fatorial(n-1), i.e., how the code assigns the value to the variable n of this line and how is done…
-
3
votes3
answers85
viewsQ: How does variable p work in this code?
I don’t know how the variable p of loop while is working on that code. If the variable p is the iteration variable, because the exercise also uses a variable p within the while to store the s.find(…
-
1
votes2
answers573
viewsQ: How do I change the language of Git to English on Linux?
I installed Git on my Ubuntu but it is in Portuguese. How can I change to English language?
-
3
votes1
answer385
viewsQ: I’m not getting loops while nested
I’m having trouble understanding this code, because I don’t understand how it behaves in loops while, follow the instructions after the code. Note 1: I am learning programming logic yet, so I am…
-
0
votes1
answer43
viewsQ: pq the input x iteration DOES NOT interfere with the while loop x iteration, where it is the same variable?
I am learning programming logic with Python and I don’t understand how the input x DOES NOT interfere with the iteration of the x from the while loop, which is the same variable. Please explain to…
-
2
votes1
answer5400
viewsQ: pq the while True loop accesses if and Else in sequence to every complete loop in that code?
#! /usr/bin/python3 valor = int(input("Digite o valor a pagar: ")) cedulas = 0 atual = 50 apagar = valor while True: if atual <= apagar: apagar = apagar - atual cedulas += 1 else: print("%d…