-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Upgrade Python tutorial to Python 3 maybe? #158
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
Conversation
python-numpy-tutorial.md
Outdated
| print x - 1 # Subtraction; prints "2" | ||
| print x * 2 # Multiplication; prints "6" | ||
| print x ** 2 # Exponentiation; prints "9" | ||
| print(type(x)) # Prints "<type 'int'>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In python 3.5, I have:
# Prints "<class 'int'>"
python-numpy-tutorial.md
Outdated
| from math import sqrt | ||
| nums = {int(sqrt(x)) for x in range(30)} | ||
| print nums # Prints "set([0, 1, 2, 3, 4, 5])" | ||
| print(nums) # Prints "set([0, 1, 2, 3, 4, 5])" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get:
# Prints "{0, 1, 2, 3, 4, 5}"|
Thanks you so much for the pull request, you're right it's time to change to python 3 ! |
|
Hi @omoindrot, |
|
Haha nothing automatic 😄 |
|
All fixed~ |
omoindrot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thank you so much !
I found that the assignments start to use Python 3 syntax by default. Moreover, Python 2 is not officially supported in the assignment 2. Maybe then it would be a good idea to update Python version in the tutorial as well to avoid confusions?