I'm doing a simple code to convert meters to millimeters, what would be the best way to handle the result. Ex: 1000 in 1,000
Code:
valor_m = int(input("Digite um valor em metros: "))
valor_mm = valor_m * 1000
print "Valor em milimetros: %i...
I came across a question with the raise and assert structures in python.
In the code below shows the implementation of structures forcing an error if the number passed is negative.
def is_neg_assert(int):
assert (int >=...
I saw that VirtualEnv provides a way to create different environments for application development in Python . And, whenever we use it, you need to install the dependencies of a specific project.
For example, I realize that when i...
Using Python 2.7.12
I need to create a list as follows:
lista = [[],[],[],[],.........,[]]
This list must have a very large number of lists within it (so the ........). I found the following way to accomplish this:
lista = [[]]*n
Wh...
I have a task and I am having difficulty completing it. What I did was this:
m= int(input('Digite o primeiro fator:'))
n= int(input('Digite o segundo fator:'))
def multiplica(numero):
while m > 0:
print (n + multiplica (m-1) n)...
Reading a book from time to time it puts __init__ or __init and I do not know what those "_" means, I tried to search the internet for some explanations, but I ended up making it harder, could someone help me explaining more practi...
I'm working on Python 2.7.
I have this result:
Resultado=[['A','B','C'],['D','E','F'],['G','H','I']]
How can I make this a list? And get the following:
Lista=['A','B','C','D','E','F','G','H','I']
Thank you!