Created
November 2, 2020 07:37
-
-
Save muxueqz/f528eb8e41cb268b13cf22968c56feec to your computer and use it in GitHub Desktop.
get_page.py
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
#coding=utf-8 | |
import sys | |
#str = raw_input() | |
#print str | |
def get_page(page_num, nums): | |
items = range(100) | |
start_num = page_num * nums | |
result = list(range(len(items)))[start_num:start_num + nums] | |
return result | |
print get_page(1, 10) | |
print get_page(2, 10) | |
print get_page(3, 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment