1
I have this code that generates combinations of numbers. When I run it, these combinations are printed on the screen.
What I want is for it to save these combinations in a txt file.
import random
c1 = (random.choice([9, 9]))
c2 = (random.choice([1, 1]))
c3 = (random.choice([9, 9, 9]))
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(3):
print ('{}{}{}{}{}{}{}{}{}{}{}'.format(c1, c2, c3, gerar_randomicus(), gerar_randomico(),gerar_randomico(), gerar_randomico(),gerar_randomico(),gerar_randomico(),gerar_randomico(), gerar_randomico()))
just take and save the numbers in a list, giving an append, and then create a txt file and make it write.
– Marlon Symczecym