Sunday, 15 March 2015

Error at print statement in Python 3 -



Error at print statement in Python 3 -

all questions find on here don't quite reply question.

i'm doing tutorial on python , using older version of it. (pre 3.0)

right showing string indexing however, syntax changed in python code invalid, here is:

s = '<any string>' print s[0]

it suppose print < syntax error. here error.

print name[0] ^ syntaxerror: invalid syntax

i have tried know cannot seem work.

can explain find right reply or tell me.

the problem not indexing, print statement.

print function in python 3, whereas in python 2, statement. need utilize such:

print(s[0])

python

No comments:

Post a Comment