Python Interactive Shell - SyntaxError with Print

I am new to Python.

I installed Python on my Windows 2003 virtual machine; Launched a Python shell; I dialed the following code -

print "Hello World" 

And he turned my back on the next

Syntax Error: invalid syntax

Here are a few other statements

 >>> x = 10 >>> print x 

Syntax Error: invalid syntax

The following worked fine.

 >>> x 

ten

Why didn't Python allow me to write a simple Hello World program?

+4
source share
1 answer

Duh! To blame.

 print(x) 

- this is a team.

Sorry people!

+5
source

Source: https://habr.com/ru/post/1333351/


All Articles