0

Why does the python 2 code throw error on assigning print to foo whereas python 3 doesn't?

Python 2

>>> foo = print
  File "<stdin>", line 1
    foo = print
              ^
SyntaxError: invalid syntax

Python 3

>>> foo = print
thisshri
  • 632
  • 8
  • 18

0 Answers0