Posts by Felipe Assis • 86 points
6 posts
-
1
votes4
answers26369
viewsA: Find certain text in a string
Hello, To verify occurrences in a string, you can use Count(), which counts how many times a given substring is found in a string. Behold: nome=input("Qual o seu nome completo?")…
pythonanswered Felipe Assis 86 -
0
votes4
answers636
viewsA: Check object array index by property
Hello, You can use the indexOf to identify the position where its value (city id) is. After that, you can remove the item with splice. In it you indicate the position where you want to start…
-
2
votes1
answer710
viewsA: Create file without knowing directory? Python
Hello, You can get the computer’s user name from the system using getpass. See: import getpass usuario = getpass.getuser() Then you can try something like this: file_create = open("C:\\Users\\" +…
-
1
votes1
answer165
viewsA: Error in python indentation
Hello, Basically about the indentation in python, it is it that defines the block of instructions to be executed by certain control instruction (loop, conditions, etc). It resembles the keys used in…
pythonanswered Felipe Assis 86 -
0
votes2
answers348
viewsA: I cannot make my result appear, only Nan appears in the IMC box.(HTML/Javascript)
Hello, As much as you fill in your fields <input> with only numbers, they still accept letters and other characters, so the captured value is a string. You should use the parseFloat() function…
javascriptanswered Felipe Assis 86 -
3
votes2
answers477
viewsA: How to access a private attribute in a class?
Hello, Change your withdrawal method. Change Account by self: def saque(self,senha, valor): if (senha == self.__senha) and (valor <= self.__saldo) : self.__saldo -= valor…