I am making a simple program for fun. This should take input for X amount of files to be filled with Y amount of random 0's and 1's.
When I run this I would like to have 2 files both filled with 20 random 0's and 1's in each file. At the moment when I run this only the first file gets filled and the second one is left empty.
I think it has something to do with my second loop but I am not sure, how can I get this to work?
import random
fileamount = int(raw_input("How many files should I make? > "))
amount = int(raw_input("How many characters in the files? > "))
print "I will now make %r files with %r characters in them!\n" % (fileamount, amount)
s1 = 0
s2 = 0
while s2 < fileamount:
s2 = s2 + 1
textfile = file('a'+str(s2), 'wt')
while s1 < amount:
s1 = s1 + 1
textfile.write(str(random.randint(0,1)))