Python作业
#coding:utf8 user_list =[] for i in range(1,302): tmp = "{'user':'alex-%s,'email':'alex%[email protected]','pwd':'pwd%s'}" %(i,i,i) user_list.append(tmp) while True: user_choice = input("请输入页码:").strip() if user_choice.isdecimal(): user_choice = int(user_choice) if user_choice >0 and user_choice <=len(user_list)/10+1: min = user_choice * 10 -10 max = user_choice *10 for item in user_list[min:max]: print(item) else: print("你输入的页码不存在,最大只能为%d页。"%(len(user_list)/10 + 1)) else: print("你输入的不是数字页面。。")
相关推荐
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17
Erick 2020-11-17
HeyShHeyou 2020-11-17
以梦为马不负韶华 2020-10-20
lhtzbj 2020-11-17
夜斗不是神 2020-11-17
pythonjw 2020-11-17
dingwun 2020-11-16
lhxxhl 2020-11-16
坚持是一种品质 2020-11-16
染血白衣 2020-11-16
huavhuahua 2020-11-20
meylovezn 2020-11-20
逍遥友 2020-11-20
weiiron 2020-11-16