What is the best way to access a variable that was created in a function? For example:
def Luggage():
mala = []
take = raw_input("O que você deseja levar na sua viagem?")
mala.append(take)
If I wanted to access and use the ma...
I have some .CAP files that came from capturing packages with tcpdump. When trying to open with wireshark, the machine gets very slow, as I imagine it will try to load everything into RAM.
I would like to write a program in Python to work mor...
In the code below I try to divide the values, but I end up getting a completely wrong answer from the calculation:
nota1 = input ("Digite a nota 1: ")
nota12 = input ("Digite a nota 1: ")
nota2 = input ("Digite a nota 2: ")
nota22 = input ("D...
I have problems with the if and else functions, I started my programming studies very soon and I did not quite understand how to use them.
Is it something like this?
número = 2
If número == 2:
Print("esse número é 2")
Else:
Pr...
T = [0,0,0,1,0,0,0,-1,0]
def acoes(T):
listaAction=[]
for i in T:
if(T[i]==0):
listaAction.append(T.index(i))
return listaAction
print(acoes(T))
How do I write list indexes that have value 0 in lis...
I need to remove the duplicate dates from the dataframe and add the values corresponding to those dates.
I found an answer in the NA stack that is close to the one I need, but I could not shape it for my need:
df.groupby('data', group_keys=...
I have a script written in Python (3.6) that works normally if run on my PC (which has Python installed)
My question is: If I run it on some other windows that do not have python installed, will it run normally? And if it does not work, is...
I tried to follow: link
import requests
dados ={"poll_id" : "9484127",
"answer_id" :"43276282",
"number_of_votes" : "1000"}
url = "https://polldaddy.com/poll/9484127/"
#while True:
requests.post(url, data=dados)
But it's still not vo...
Hello,
I'm creating a script to do automatic machine logins. I created a list with several IPs that are the equipment that I want to access. I want to create a loop, tried with while and for, but I could not.
Each lap in the loop it should...