Tuesday, April 23, 2013

Something I Need To Drill Into My Brain - Python

The operation of the slicing operator:
>>> word[:2]    # The first two characters
'He'
>>> word[2:]    # Everything except the first two characters
'lpA'

No comments:

Post a Comment