Friends,
I have the following code in Python:
data_hoje = time.strftime("%d %b %Y", time.gmtime() ) #data de hoje
data_desejada = time.strftime("%d %b %Y", time.gmtime(time.time() + (3600 * 24 * 2))) # daqui a 2 dias
I know that in Pyth...
Create a program where the user can type multiple numeric values and sign them into a list. If the number already exists inside, it will not be added. At the end, all the unique values entered will appear in ascending order.
And so far so...
I'm writing an algorithm where I increment float variables in 0.2 , however, after a few increments instead of increasing 2.2 to 2.4 , for example, the program increments to 2.4000000000000004
I've read about this...
I always have a lot of trouble with replace and sub. I know how they work, but it never works for me. I have a list of words and I am trying to replace these words in a text:
Text:
Brazil, officially the Federative Republic of Brazil...
I have a list like this:
Lista_A = [['de','do','da','ou'],['ae','ay','yhh','oo'],['ow','pa','la','for']]
How do I leave it like this:
Lista_A_new = ['de','do','da','ou','ae','ay','yhh','oo','ow','pa','la','for']
Declaring a list
>>> convites = ['Flavio Almeida', 'Nico Steppat', 'Romulo Henrique']
When it shows, it appears like this
>>> convites[0]
'Flavio Almeida'
>>> convites[1]
'Nico Steppat'
>>> convites[2]...
Many times when I need to debug the value of a variable at runtime I use print() .
But when there are many variables, I need to identify the name of the variable along with the value.
In this way print becomes more laborious :
pri...
I'm starting to work with Python and I've seen that there's no way to create multiple con- trollers in the same class. With this I thought of passing to the% co_conductor an object containing the attributes of the class, as in the example:
cla...
I have a file of 1000 lines and I want to read line 952.
I do not want to have to use a loop to go through all those lines, is there any more optimized way to do this?