寸草心2130

 

2018年12月6日

python内置函数 和模块函数总结

摘要: 1.内置函数(无需导入)long() 函数将数字或字符串转换为一个长整型。len() 统计元素个数print() 打印,输出input() 输入,或阻塞程序运行type 获取类型range 产生连续的整数对象enumerate 枚举可迭代对象ord 字符转ASCIIchr ASCII转字符abs 求 阅读全文

posted @ 2018-12-06 19:53 寸草心2130 阅读(569) 评论(0) 推荐(0)

python字符串 列表 元组 字典相关操作函数总结

摘要: 1.字符串操作函数 find 在字符串中查找子串,找到首次出现的位置,返回下标,找不到返回-1 rfind 从右边查找 join 连接字符串数组 replace 用指定内容替换指定内容,可以指定次数 split 切割字符串sep:指定按照什么进行切割,默认按照空格切割 # maxsplit:指定最大切割次数,默认不限制次数 splitlines 按照换行进行切割 count 搜索指定字符串出现... 阅读全文

posted @ 2018-12-06 19:51 寸草心2130 阅读(173) 评论(0) 推荐(0)

python 随机生成图片验证码背景RGB-浅色或者深色

摘要: 1 import random 2 def random_color(is_light = True): 3 return (random.randint(0 ,127) + int(is_light) * 128,random.randint(0,127) + int(is_light) * 128,random.randint(0,127) + int(is_light) * 128... 阅读全文

posted @ 2018-12-06 17:41 寸草心2130 阅读(940) 评论(0) 推荐(0)

导航