Skip to content

Instantly share code, notes, and snippets.

@muxueqz
Created November 2, 2020 07:37
Show Gist options
  • Save muxueqz/f528eb8e41cb268b13cf22968c56feec to your computer and use it in GitHub Desktop.
Save muxueqz/f528eb8e41cb268b13cf22968c56feec to your computer and use it in GitHub Desktop.
get_page.py
#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