打印从QQQQQQQQQQ到0000000000

l = 'QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890'
file = open('brute', 'w')
def stl(s):
	r = []
	for i in range(0, len(s)):
		r.append(s[i])
	return r
def lts(l):
	r = ''
	for i in l:
		r += str(i)
	return r
s = stl('Q' * 10)
file.write(lts(s) + '\n')
def move(s, i):
	if s[i] != l[-1]:
		return i
	else:
		return move(s, i -1)
def add(s):
	i = move(s, len(s) - 1)
	s[i] = l[l.find(s[i]) + 1]
	for j in range(i, len(s) - 1):
		s[j + 1] = l[0]
	return s
while s != stl(l[-1] * 10):
	s = add(s)
	file.write(lts(s) + '\n')
file.close()

 

你可能感兴趣的:(打印从QQQQQQQQQQ到0000000000)