Parenthesis Syntax


#1

I have used IDLE for my CS class to code in Python, and I created an account here to get extra practice. I have coded in C before so I have a programming knowledge base.

Using this course in Python, I can simply type (see below) and have no issues.
print "hi"

In IDLE if I type that exact code an error comes up. I need parenthesis around the quotes.

Why is this? Why are the compilers different.

Replace this line with your code.


#2

Your IDLE is using Python 3. Here, you're using Python 2.7.3.


#3

In Python 2.x.x print is a construct, whereas in Python 3.x.x. it is a function. You may use Python 3 syntax without any issues so long as the SCT is not scanning the actual code.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.