Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error #7

Open
ghost opened this issue Aug 24, 2020 · 4 comments
Open

Error #7

ghost opened this issue Aug 24, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 24, 2020

Hello,

I am trying to run this python code but I am receiving an error in the following line of code

print "Starting gradient descent at b = {0}, m = {1}, error = {2}".format(initial_b, initial_m, compute_error_for_line_given_points(initial_b, initial_m, points))

@mattnedrich
Copy link
Owner

Hi @Mayssa-1195, what version of Python are you using? What is the error?

@ghost
Copy link
Author

ghost commented Aug 30, 2020

I am using Python version 3.8.3. This is the error:

File "gradient_descent_example.py", line 39
print "Starting gradient descent at b = {0}, m = {1}, error = {2}".format(initial_b, initial_m, compute_error_for_line_given_points(initial_b, initial_m, points))
^
SyntaxError: invalid syntax

@mattnedrich
Copy link
Owner

Some of the code doesn't work in Python 3. If you change the print statements to function calls, like

print("Starting gradient descent at b = {0}, m = {1}, error = {2}".format(initial_b, initial_m, compute_error_for_line_given_points(initial_b, initial_m, points)))

That may be enough to get things working.

@ghost
Copy link
Author

ghost commented Aug 30, 2020

@mattnedrich Okay Thank you ! I will try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant