You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def is_one(val):
return val==1
foo = [1, 2, 3]
print("any foo", any(is_one(v) for v in foo))
bar = [11, 2, 3]
print("any bar", any(is_one(v) for v in bar))
any foo True
any bar False
Converted Javascript
var is_one = function (val) {
return val == 1;
};
var foo = list ([1, 2, 3]);
print ('any foo', any (is_one (v)vfoo));
var bar = list ([11, 2, 3]);
print ('any bar', any (is_one (v)vbar));
gets SyntaxError: missing ) after argument list
The text was updated successfully, but these errors were encountered:
shaolo1
changed the title
Python any not translated properly
Python any() not translated properly
Apr 13, 2016
Things like any, all and sum are not yet in. They will probably in a separate library too keep downloads small, together with other functional programming facilities. That will wait until the PY3.6 / JS6 version, since that has better support for FP concepts.
Python
any foo True
any bar False
Converted Javascript
gets SyntaxError: missing ) after argument list
The text was updated successfully, but these errors were encountered: