 python3学习手册sort(reverse=True) # 排序,降序,从大到小 listxx.reverse() # 反转列表,头变尾,尾变头 del listxx[1:3] # 切割操作,删除列表的这一段,含头不含尾 newlist = sorted(listxx) # 返回新列表,且排好序了,升序,原 listxx不变 ②set数据操作(无序,数值不重复) True,否则返回False # 输入 "10.99.1.33-55" 输出 True # 输入 "10.99.1.22-10" 输出 False ,不是正确的地址范围,首 ip大于了尾ip # input python3学习手册sort(reverse=True) # 排序,降序,从大到小 listxx.reverse() # 反转列表,头变尾,尾变头 del listxx[1:3] # 切割操作,删除列表的这一段,含头不含尾 newlist = sorted(listxx) # 返回新列表,且排好序了,升序,原 listxx不变 ②set数据操作(无序,数值不重复) True,否则返回False # 输入 "10.99.1.33-55" 输出 True # 输入 "10.99.1.22-10" 输出 False ,不是正确的地址范围,首 ip大于了尾ip # input- , output - seg_list = input_str.split(".") if len(seg_list) != 4: # 输入 "10.99.1.33-10.99.1.55" 输出 True # 输入 "10.99.1.22-10.99.1.10" 输出 False ,不是正确的地 址范围,首ip大于了尾ip # input - , output - input_seg = input_str.split("-") seg1_list = input_seg[0] 0 码力 | 213 页 | 3.53 MB | 1 年前3
共 1 条
- 1














