1
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:45:13) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print "Harshit"
SyntaxError: invalid syntax

Where is the problem here?

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
harspt92
  • 97
  • 2
  • 8

1 Answers1

1

You are trying to use Python 2.x syntax in Python 3.x.

In Python 3.x, print is no longer a statement. Instead, it was converted into function and therefore must now be called like one:

>>> print("hi")  # Note the parenthesis
hi
>>>