python
过儿-_-
这个作者很懒,什么都没留下…
展开
-
python中的product函数(可对多个列表进行排列组合)
product函数用于求多个可迭代对象的笛卡尔积举例:使用product函数from itertools import producta = [1, 2, 3]b = [4, 5, 6]for n in product(a, b): print(n)(1, 4)(1, 5)(1, 6)(2, 4)(2, 5)(2, 6)(3, 4)(3, 5)(3, 6)用双循环遍历a = [1, 2, 3]b = [4, 5, 6]for i in a: for原创 2020-05-13 11:20:08 · 3586 阅读 · 0 评论 -
Python 中的find()函数
1、Python find() 方法检测字符串中是否包含子字符串 str如果指定 beg(开始) 和 end(结束) 范围,则检查是否包含在指定范围内,如果包含子字符串返回开始的索引值,否则返回-1。2、find()函数的语法str.find(str, beg=0, end=len(string))参数str – 指定检索的字符串beg – 开始索引,默认为0。end – 结束索引...转载 2020-05-07 10:34:40 · 2486 阅读 · 0 评论 -
Python中的lambda
...转载 2019-12-12 10:15:32 · 101 阅读 · 0 评论 -
一段代码来理解@property装饰器
# -*- coding: utf-8 -*-"""@File : property.py@Author : minmin@Time : 2019\12\10 0010 11:37""""""@property只读@property和@*.setter可读可写@property和@*.setter和@*.deleter可读可写可删除"""class Clo...原创 2019-12-10 17:05:37 · 151 阅读 · 0 评论