#!/usr/bin/env python3# -*- coding: utf-8 -*-L = ['Michael', 'Sarah', 'Tracy', 'Bob', 'Jack']print('L[0:3] =', L[0:3])print('L[:3] =', L[:3])print('L[1:3] =', L[1:3])print('L[-2:] =', L[-2:])R = list(range(100))print('R[:10] =', R[:10])print('R[-10:] =', R[-10:])print('R[10:20] =', R[10:20])print('R[:10:2] =', R[:10:2])print('R[::5] =', R[::5])l = list(range(100))print lprint(l[23])#取前十个数print(l[:10])#取后十个数print(l[-10:])#取前11--20个数print(l[10:20])#所有数中每2个取1个 就是说取索引中 第0个 第2个 第4个以此类推print(l[::2])