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...
On line 10, even though I choose option 2 to not continue in the game, End of Game appears but the code continues to roll.
On the line marked (line 10), even if I choose option 2, which should be the end of the game, the game still continues...
How can I create a word in a list? for example:
entrada:
a='carro'
saida:
['c','a','r','r','o']
I know that using split transforms into list gets the whole word, I wonder if as a specific word turn list.
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...