Difference between revisions of "Python - Lambda"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) (Created page with "=Examples= <pre> #!/usr/bin/env python27 crange = lambda c1, c2: [ chr(c) for c in range(ord(c1), ord(c2)+1) ] print crange('A', 'Z') print crange('0', '9') </pre> [[Cate...") |
PeterHarding (talk | contribs) |
||
Line 2: | Line 2: | ||
<pre> | <pre> | ||
#!/usr/bin/env | #!/usr/bin/env python | ||
crange = lambda c1, c2: [ chr(c) for c in range(ord(c1), ord(c2)+1) ] | crange = lambda c1, c2: [ chr(c) for c in range(ord(c1), ord(c2)+1) ] |
Latest revision as of 11:46, 31 January 2012
Examples
#!/usr/bin/env python crange = lambda c1, c2: [ chr(c) for c in range(ord(c1), ord(c2)+1) ] print crange('A', 'Z') print crange('0', '9')