Skip to content

Conversation

@shaform
Copy link
Contributor

@shaform shaform commented May 30, 2017

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?

print x - 1 # Subtraction; prints "2"
print x * 2 # Multiplication; prints "6"
print x ** 2 # Exponentiation; prints "9"
print(type(x)) # Prints "<type 'int'>"
Copy link
Contributor

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'>"

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])"
Copy link
Contributor

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}"

@omoindrot
Copy link
Contributor

Thanks you so much for the pull request, you're right it's time to change to python 3 !

@shaform
Copy link
Contributor Author

shaform commented May 30, 2017

Hi @omoindrot,
Thanks for the review, I've fixed the points you mentioned.
Just curious if you are using some automatic tools to check python code in a markdown document. (Because I actually made this PR manually, which was a little bit tedious 😂.)

@omoindrot
Copy link
Contributor

Haha nothing automatic 😄
Could you fix all the <class ...> instead of <type ...> please?

@shaform
Copy link
Contributor Author

shaform commented May 30, 2017

All fixed~

Copy link
Contributor

@omoindrot omoindrot left a 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 !

@omoindrot omoindrot merged commit 05ce4b5 into cs231n:master May 30, 2017
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

Successfully merging this pull request may close these issues.

2 participants