Questions tagged as 'python'

1
answer

What is the Print Flush In Python? [closed]

I can not understand how the flush works in python's print.     
asked by 16.04.2018 / 23:07
3
answers

Floating-point problem Python 3

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...
asked by 06.02.2018 / 23:48
2
answers

Code continues to run after the game ends

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...
asked by 15.12.2017 / 00:45
1
answer

How to turn a single word into a list? python

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.     
asked by 30.11.2018 / 13:26
2
answers

Regex for monetary values

I would like to know how to make a regex to capture a monetary value with semicolons. Ex: 7.300.250,00     
asked by 12.11.2018 / 16:04
3
answers

Replace list of words in a text

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...
asked by 17.07.2018 / 14:52
2
answers

How do I read python row by line?

Let's suppose I have a txt file with some data: [File.txt] Oie Olá Tudo bem? I want something (in python) that reads line by line and print.     
asked by 26.09.2017 / 18:05
2
answers

Manipulating list of lists in Python

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']     
asked by 08.10.2017 / 23:08
2
answers

Why does the list show the first two elements?

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]...
asked by 19.02.2016 / 11:26
4
answers

Debug showing variable name and value?

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...
asked by 30.09.2018 / 16:27