Lucky and even lucky numbers: Difference between revisions

→‎{{header|Python}}: Moved some definitions around to further highlight diff between algorithm and argument handling.
(corrected the description of even luckies; changed odd to match)
(→‎{{header|Python}}: Moved some definitions around to further highlight diff between algorithm and argument handling.)
Line 147:
The generator
<lang python>from __future__ import print_function
from itertools import islice
import sys, re
 
class ArgumentError(Exception):
pass
 
def lgen(even=False, nmax=1000000):
Line 167 ⟶ 162:
 
The argument handler
<lang python>deffrom arghandler(argstring):itertools import islice
import sys, re
 
class ArgumentError(Exception):
pass
def arghandler(argstring):
match_obj = re.match( r"""(?mx)
(?:
Anonymous user