
python
python学习笔记(从零到入土)
W_Kenneth
这个作者很懒,什么都没留下…
展开
-
python,序列切片参数解析
sequence[start : end : step]有step参数时,end参数默认0;没有step参数时,end参数默认len(sequence)step不可为0,默认1第二个参数不填写时,取值区间为[start,end];第二个参数写了的话,取值区间为[start,end)eg:反转列表中的元素 list = [1, 2, 3, 4, 5]; rlist = list[-1::-1]; # [5,4,3,2,1] #从倒数第一个元素(-1)开始读取,一直到第一个元素(包括第一个,当第原创 2021-07-14 11:37:10 · 218 阅读 · 0 评论 -
python,set(集合)的运算
原创 2021-07-13 11:17:50 · 189 阅读 · 0 评论 -
python,isinstance()函数第二个参数常用的值
print(help(isinstance));'''Help on built-in function isinstance in module builtins:isinstance(obj, class_or_tuple, /) Return whether an object is an instance of a class or of a subclass thereof. A tuple, as in ``isinstance(x, (A, B, ...))`原创 2021-07-13 11:15:50 · 356 阅读 · 0 评论