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
  • 115,751
  • 26
  • 228
  • 437
harspt92
  • 95
  • 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
>>>