Skip to content

Instantly share code, notes, and snippets.

@a1exlism
Created July 23, 2016 14:24
Show Gist options
  • Save a1exlism/1fa1643a75b439b30f333600593e796a to your computer and use it in GitHub Desktop.
Save a1exlism/1fa1643a75b439b30f333600593e796a to your computer and use it in GitHub Desktop.
Collection the differences in python when reading <<Python core programming>>
#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