Posts by William Teixeira • 313 points
13 posts
-
2
votes2
answers37
viewsA: Why does entering a value in a list become None?
Hi, your assignment in: valor1 = valores.append(int(input('Valor 1: '))) valor2 = valores.append(int(input('Valor 2: '))) You’re wrong about the variables valor1 and valor2 there is nothing, so…
-
1
votes1
answer75
viewsA: Return name instead of foreign key ID
Hello, there are two ways I know how to solve your problem: First Form def consultar_estoque(self): estoque = self.cursor.execute("""SELECT doacoes.nome, doacoes.litros, doacoes.tipo, pessoas.nome…
-
1
votes1
answer73
viewsA: Jsondecodeerror Expecting value: line 1 column 1 (char 0) - content-type: text/xml
Hello, I don’t know exactly what you want to do but can read the xml this way: import requests import xml.etree.ElementTree as ET params = { 'latitude': -23.4887194, 'longitude': -46.6701079,…
-
-1
votes1
answer418
viewsA: How do I make Python click a button in google?
Hello, you are doing well. To click on a button you must locate it using by: xpath, id, class or tag and then use the method .click(). 1 - geckodriver my_button =…
-
2
votes2
answers50
viewsA: Deleting lines with repeated Labels on a Dataframe
Hello, you can wear df.drop_duplicates() to filter the fields. Pandas import is implicit and dataframe creation I will also use your example that is so: df_sem_duplicacao =…
-
1
votes1
answer93
viewsA: How to interpret the composition connector in a class diagram?
Composition is a strong all-party relationship. It indicates that the whole is composed of the parts. The tip of the arrow indicates what is the whole in the relationship. In practice, the class…
-
0
votes1
answer52
viewsA: ex de python help!
I made some changes to tidy up the logic. There are many ways to do it, I opted for the simplest. arr_valores = [] arr_falta = [] # essa varíavel só interfere no if # para impedir a leitura que mais…
-
0
votes1
answer154
viewsA: Python/Smtp - sending multiple emails
Hello, you need to just correctly sort the instructions inside the loop: .... # Faz login na conta de email. # create message object instance msg = MIMEMultipart() password = "sua_senha" msg['From']…
-
0
votes2
answers78
viewsA: Doubt replace in pandas
First palavras will have content: "legend". The correct statement of lists is: palavras = ['computadores', 'uma', 'lenda'] Then comes the next problem. df['texto'] has only 1 value (the correct term…
-
0
votes1
answer33
viewsA: Attach only one line to a CSV file with pandas
Hello, well let’s go by parts. I had a little trouble understanding your problem :) whereas respostas is a list and that framelogin and frameclientes sane dataframes, where framelogin has data that…
-
4
votes1
answer491
viewsA: Two dice game in Python
Hello, first I’ll rewrite your function a little bit: import random # biblioteca com funções prontas para gerar valores aleatórios def lancar_dados(): cont = 0 # aqui vamos contar quantas vezes os…
pythonanswered William Teixeira 313 -
0
votes3
answers661
viewsA: Doubt - insert element at the end of the list - (Python)
Use the method .append() arr = [1, 2, 3] arr.append(4) # [1, 2, 3, 4] as lists are heterogeneous structures, you can store strings (words or text in simple terms). Using the same list:…
pythonanswered William Teixeira 313 -
-1
votes3
answers2247
viewsA: Typeerror: Object of type 'Nonetype' has no Len()
As I said, there’s one missing return in display_topics. Your mistake is quite common, as expected the changes in display_topics have an effect outside the function, this is called scope.…