В python 3 печать больше не является оператором, а функцией .
Old: print "The answer is", 2*2
New: print("The answer is", 2*2)
Дополнительные функции Python 3 print
:
Old: print x, # Trailing comma suppresses newline
New: print(x, end=" ") # Appends a space instead of a newline
Old: print # Prints a newline
New: print() # You must call the function!
Old: print >>sys.stderr, "fatal error"
New: print("fatal error", file=sys.stderr)
Old: print (x, y) # prints repr((x, y))
New: print((x, y)) # Not the same as print(x, y)!