2
I made this number generator that gets saved in a csv file that I open in excel, the combinations are generated in column A but n want it to appear in A. as I do for her to appear in column B and C?
generate in B, paste in C the same combinations of B
import random
c1 = (random.choice([9, 9]))
c2 = (random.choice([1, 1]))
c3 = (random.choice([9, 9, 9]))
lista = []
print ('---criado por xxx---')
rc = int (input('Quantas combinacoes?: '))
def gerar_randomico():
return random.choice([2, 3, 4, 5, 6, 7, 8, 9])
def gerar_randomicus():
return random.choice([6, 7, 8, 9])
for i in range(rc):
lista1 = ('{}{}{}{}{}{}{}{}{}{}{}\n'.format(c1, c2, c3, gerar_randomicus(), gerar_randomico(), gerar_randomico(),
gerar_randomico(), gerar_randomico(), gerar_randomico(),
gerar_randomico(), gerar_randomico()))
with open('arquivo.csv','a') as arquivo:
arquivo.write(str(lista1))
lista_guardar = lista.append(arquivo)
print(lista_guardar)
n worked, this added a "0," in front of each number started with 91
– felipe