Posts by Arthur Bacci • 97 points
12 posts
-
0
votes1
answer272
viewsA: Tracerouter in python error:<lambda>() Missing 1 required positional argument: 'r'
Lambda is basically a function, for example: def vezes_dois(n): return 2 * n May be replaced by vezes_dois = lambda n: 2 * n What’s happening is that your lambda requires s and r, but you’re only…
-
0
votes2
answers48
viewsA: I’m trying to make a show that gets an n number and returns all the cousins up to n, but I don’t know what’s going wrong
Your code has some errors, for example: change this =+ for +=. I made the following changes: numero = int(input('Digite um número: ')) lista_numeros = list(range(2, numero + 1)) primos = []…
pythonanswered Arthur Bacci 97 -
0
votes1
answer23
viewsA: Failed to access server socket via internet python3
If you can with the browser, then probably the problem is in the client and not in your server. I hope I’ve helped.
-
0
votes1
answer48
viewsA: How can I print my results in a text file?
You can do the following: buf = "" # cria um buffer para substituir o stdout buf += "string" # fazer isso ao invés de print("string") with open("filename", "w") as f: f.write(buf) Or create another…
-
0
votes1
answer24
viewsA: Check between excel and windows lists
I think I get it: your base list is a string and not a list, switch to listabase.split("\n") that I think will work.
-
2
votes3
answers348
viewsA: Arithmetic operations where some Dataframe data is not int in Python (pandas)
Using the for is never out of the question! What your code does is the same as a for, you just don’t write the for. The best way is to use the for: data1 = {'local': ['São Paulo', 'Rio de Janeiro',…
-
0
votes1
answer119
viewsA: How to join two lines in the same scale of the graph?
Mine has worked out: import matplotlib.pyplot as plt def createGraph(): plt.title("Evolution of COVID-19") plt.xlabel("Days") plt.ylabel("Infected People") countries = ['China', 'Italy'] days = [1,…
-
3
votes2
answers165
viewsA: Python how to repeat my code
For this you can use the while loop or the for loop: import pyautogui import time i = 0 while i < 300: pyautogui.moveTo(28,295,duration=0.5) pyautogui.click(30,295,duration=0.5)…
-
-3
votes1
answer99
viewsA: Help to send data by python post method
403 - Forbidden is an error that occurs when something is wrong in the request, usually. For example: when a website detects that what you are sending to it may be dangerous to the site it returns…
-
0
votes1
answer37
viewsQ: Variable assigned to another parent variable
Hello, I’m having a problem with Python3: When I create a list and assign the value of another variable to that list, when I change the variable the list is changed, code: lista = ["uau", "nossa"]…
-
1
votes1
answer82
viewsQ: Pascal’s triangle is in infinity
I’m making a code that generates a Pascal triangle for a project of mine, but when I spin it gets stuck, as if the is infinite. function pascal(n) { var d; var uau = ""; var line; var i; for(line =…
-
-2
votes1
answer117
viewsA: Export data to a file . cfg
You can create a file using arquivo = open('arquivodeconfig.cfg', 'r') #assim você pode usar arquivo.read() para aparecer o que está no arquivo print(arquivo.read()) arquivo =…