标签:sel return show pre app row list lis start
class Page:
def __init__(self, data_list, page_num, page_sum=10):
self.data_list = data_list
self.page_num = page_num
self.page_sum = page_sum
@property
def start(self):
page_start = (self.page_num - 1) * self.page_sum
return page_start
@property
def end(self):
page_end = self.page_num * self.page_sum
return page_end
def show(self):
for row in self.data_list[self.start: self.end]:
print(row)
lst = []
for i in range(1, 301):
lst.append(i)
while True:
number = int(input(‘请输入页码:‘))
page_sums = int(input(‘请输入每页显示的数量:‘))
obj = Page(lst, number, page_sums)
obj.show()
标签:sel return show pre app row list lis start
原文地址:https://www.cnblogs.com/hadibingjing/p/12320643.html