I wrote this expression
[0 for j in range(4)]
and python accepted it as definition of list, but when i wrote this expression:
0 for j in range(4)
it raises an error.
what is mechanism of that and from which language does it origin? is it from functional programming ie. LISP? What is equivalent in Java or C?
EDIT: the difference from answered question is that there is not left part of equitation, just right part
[code]
Also I was interested in origin of list comprehension and equivalents in other programming languages.