1
for i in range(10):
    x = 0.1*i
    print x
    print x/(1-x*x)

I'm trying to print the results out using for loop, but it says Syntax Error: Missing parentheses in call to 'print'.

I'm using Python 3.4 and I'm new to Python.

Tim Pietzcker
  • 328,213
  • 58
  • 503
  • 561

2 Answers2

1

The error message is crystal clear, isn't it? Your print function is missing the parentheses needed for a function call:

print(x)

Python 2 had a print statement where the syntax print x was correct; Python 3 has changed this. You should be learning Python from a Python 3 specific resource, for example the Python tutorial.

Tim Pietzcker
  • 328,213
  • 58
  • 503
  • 561
1

You syntax for print statement is valid in 2.X but it has changed in 3.X version. You need parentheses around your print statement like:

print (x/(1-x*x))
SMA
  • 36,381
  • 8
  • 49
  • 73