Created
July 23, 2016 14:24
-
-
Save a1exlism/1fa1643a75b439b30f333600593e796a to your computer and use it in GitHub Desktop.
Collection the differences in python when reading <<Python core programming>>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Array | |
aList = [1, 2, 3, 4] | |
aList[2:] #[3, 4] | |
#Variables | |
a = 1 | |
a++ --a # Wrong no function for this | |
# mul-tuple | |
(x, y, z) = (1, 2, 'a string') | |
# using mul-tuple to exchange two variables | |
x, y = 1, 2 | |
x, y = y, x #2, 1 | |
# about underline from: http://python.jobbole.com/81129/ | |
_xxx # declare Private | |
__xxx # avoid the conflict with subClass's name | |
__xxx__ # System Variables | |
''' | |
Tab need to be replaced by 4-space | |
''' | |
# Slice Object | |
sequence[startIndex, endIndex, Length] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment