-2

So I've installed python 3.3.4 on my machine and i'm trying to run the most basic code

import sys

file = "Wikipedia.org"
print str(file)

but I keep getting an InvalidSyntax Error.

I was wondering if there is something wrong with the install or path of python that i am running?

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
PGDJ
  • 3
  • 3

1 Answers1

3

In python 3 you should use print()

file = "Wikipedia.org"
print(file)

And you don't need to use str() - variable file already contains string value

Andrii Rusanov
  • 4,405
  • 2
  • 34
  • 54