SyntaxError: invalid syntax in inline function
I am trying to perform one program with the list comprehension Python. But it is showing the syntax error.
a = [1,2,3]
b = [i*2 for i in a if i>0 else 0 ]
print(b)
1 Answer
4 years ago by Divya
I am trying to perform one program with the list comprehension Python. But it is showing the syntax error.
a = [1,2,3]
b = [i*2 for i in a if i>0 else 0 ]
print(b)