-6

I am using python version 3.5.2 and the print function isn't working for me. THis is the code. I recieve an error saying: "missing preantheses in calling to print"

print 'Output After Training:'

thanks

2 Answers2

7

Add the parenthesis:

print('Output After Training:')

If you need compatibility for code so works with Python 2 or 3, use:

from __future__ import print_function

at the start of the code file and then use Python 3 way of using print().

Learn more about print() in Python 3 at:

Graham Dumpleton
  • 56,277
  • 6
  • 111
  • 129
3

The answer to your question is in the error... missing parentheses in calling to print

Python3 requires you to use parentheses when using print - i.e. print("text")

rst-2cv
  • 990
  • 14
  • 30