Computer Science, asked by mrnews2004, 6 months ago

>>>if(3):

print('foo')​

Answers

Answered by arukkm
0

Explanation:

>>> l = [1,2,3]

>>> x = 1

>>> x in l and lambda: print("Foo")

x in l && print "Horray"

^

SyntaxError: invalid syntax

A bit of googling revealed that print is a statement in python2 whereas it's a function in python3. But, I have tried the above snipped in python3 and it throws SyntaxError exception.

Similar questions