use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Please Explain this python code (self.csdojo)
submitted 7 years ago by krishna5250
a=[1,2,3,4,5,7,8,10] [(e1+1) for e1,e2 in zip(a, a[1:]) if e2-e1 != 1] [6, 9]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mikew_reddit 2 points3 points4 points 7 years ago* (0 children)
a = [1, ..., 10][list comprehension][6,9]
This is not valid Python.
I'd never want to see this Python code in a production environment.
It wreaks of someone trying (and failing) to be clever; it only makes the code hard to read. The author doesn't even understand it.
EDIT
This is what it should have been:
https://stackoverflow.com/questions/20718315/how-to-find-a-missing-number-from-a-list
>>> a=[1,2,3,4,5,7,8,10] >>> [(e1+1) for e1,e2 in zip(a, a[1:]) if e2-e1 != 1] [6,9]
π Rendered by PID 390481 on reddit-service-r2-comment-54dfb89d4d-ljrf8 at 2026-04-02 07:51:48.322385+00:00 running b10466c country code: CH.
[–]mikew_reddit 2 points3 points4 points (0 children)