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

self.seed #26

Open
kevinoost opened this issue Mar 6, 2018 · 2 comments
Open

self.seed #26

kevinoost opened this issue Mar 6, 2018 · 2 comments

Comments

@kevinoost
Copy link

kevinoost commented Mar 6, 2018

FYI:

spark-movie-lens/engine.py", line 121
    self.seed = 5L
SyntaxError: invalid syntax

Python 3.5 does not support this.

@arpit-dwivedi
Copy link

So what is the solution of it for running on python 3?

@finesure2017
Copy link

Just drop the L; all integers in Python 3 are long. What was long in Python 2 is now the standard int type in Python 3.

The original code doesn't have to use a long integer either; Python 2 switches to the long type transparently as needed anyway.

Note that all Python 2 support is shortly ending (no more updates after 2020/01/01), so at this point in time you'd be much better of switching tutorials and invest your time in learning Python 3. For beginner programmers I recommend Think Python, 2nd edition as it is fully updated for Python 3 and freely available online. Or pick any of the other Stack Overflow Python chatroom recommended books and tutorials

If you must stick to your current tutorial, you could install a Python 2.7 interpreter instead, and work your way through the book without having to learn how to port Python 2 to Python 3 code first. However, you'd then also have to learn how transition from Python 2 to Python 3 in addition.

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

3 participants