Python Learning: 03

    An inch is worth a pound of gold, an inch of gold is hard to buy an inch of time.

Slice

    When the scale of data is so large that we have to pick a short of the content, the best way is to use Slice.

Forward Slice

>>>L=range(1,101) >>>L[1:] #until the end >>>L[:101] #from the first >>>L[1:100] >>>L[1:101:2] #pick one in two

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wspgsz.html