[Tutor] List all possible 10digit number
Dwight Hutto
dwightdhutto at gmail.com
Sat Sep 1 07:46:24 CEST 2012
Here's the better function fixed with a return statement I forgot, but
might not be as quick as the pre-built functions already shown:
def iterToHighNum(increment,high_num):
end_point = 0
a = [i for i in range(0,increment)]
while (end_point != high_num) == True:
for integer in a:
if integer != high_num:
print "no match, integer = %i" % (integer)
end_point += 1
if end_point == high_num and integer != (high_num - 1):
print 'match, integer = %i, high_num = %i' %
(integer,high_num)
return
previous_increment = increment
increment += increment
a = [i for i in range(previous_increment,increment)]
#instance
increment = 10000
high_num = 1000000
iterToHighNum(increment,high_num)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120901/0b485eb3/attachment.html>
More information about the Tutor
mailing list