5/16 Need explanation. Thanks


#1

So I used python 3.4.3. and PyScripter to try this exp

parrot = 'Norwegian Blue'
len(parrot)
print len(parrot)

but it didn't work. And gave me an error:

SyntaxError:
invalid syntax (string_consol_output.py, line 3)

if I do this way

parrot = 'Norwegian Blue'
len(parrot)
print (len(parrot))

or

parrot = 'Norwegian Blue'
print (len(parrot))

it works fine. So what's wrong with the first example? Thanks


#2

The print statement was removed in Python 3
The function by the same name is used instead.