0

I just joined a course called introduction to python on coursera. They showed like print "Hello" or print 'hello' is working on their online tool called codeSculptor.

But on my PC its showing an error.

print ("hello") is working fine on my PC.

Why is it like that?

Jens
  • 20,533
  • 11
  • 60
  • 86

3 Answers3

2

You are probably running Python 3, whereas the class is using Python 2. The print statement is something that changes between the versions - try this to make sure. How do I check what version of Python is running my script?

Community
  • 1
  • 1
Andrew
  • 6,295
  • 11
  • 56
  • 95
0

You are likely missing some considerable setup factors on your PC.

  1. Make sure Python is actually installed on your PC.
  2. Read up on how to run Python on your PC

The online course is hiding a lot of the behind the scenes parts that make it more approachable.

Otherwise, please include the specific errors to further debug.

cchapman
  • 3,269
  • 10
  • 50
  • 68
0

The print('hello') call is necessary if you are using Python 3.

print 'hello' will still be fine in previous versions.

There might be more changes in what you already learned so keep that in mind that differences between 2.7 and 3 are not just cosmetic.

zubergu
  • 3,646
  • 3
  • 25
  • 38