Please help me out with this Python error - 'invalid syntax' Code:

import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
house_price = [245, 312, 279, 308, 199, 219, 405, 324, 319, 255]
size = [1400, 1600, 1700, 1875, 1100, 1550, 2350, 2450, 1425, 1700]
size2 = np.array(size).reshape((-1, 1))
#fitting into the model
regr = linear_model.LinearRegression()
regr.fit(size2, house_price)
print("Coefficients: \n", regr.coef_)
print("intercept: \n", regr.intercept_)
#############################
#formula obtained for the trained model
def graph(formula, x_range):
   x = np.array(x_range)
   y = eval(formula)
   plt.plot(x, y)
#plotting the prediction line 
graph('regr.coef_*x + regr.intercept_', range(1000, 2700))
print(regr.score(size2, house_price))
plt.scatter (size,house_price, color='black')
plt.ylabel('house price')
plt.xlabel('size of house')
plt.show()


Error


**Error Line:print regr.predict([2000])**
Error: File "&lt;ipython-input-4-9afa91ca7f9e&gt;", line 1
    print regr.predict([2000])
             ^
SyntaxError: invalid syntax
In your current line 

print regr.predict([2000])


This will not work. The first error is the lack of brackets around the contents of your print statement which is required in Python 3. Change this first to

print(regr.predict([2000]))


However, you will see that this does not work either. I suspect you are attempting to evaluate the price for a new $size = 2000$. You will need to reshape the input to your regression for this to work. 

new_size = np.array([2000]).reshape((-1, 1))
print(regr.predict(new_size))



  [ 317.78380528]