鉴于学习时好多参数对像都不知道是什么玩意有什么方法,搜了半天一个 """arg为一个对像,下面是打印所有对像方法"""for i, func in enumerate(dir(arg), 1): print(i, func) # 查看arg对像所有方法for i, func in enumerate(dir(arg), 1): print(i, func)…
python的字符串有众多方法,可以在doc文档中查看 示例 转换开头字母为大写 c1="welcome to my python" >>> c1.capitalize() 'Welcome to my python' >>> print(c1) welcome to my python >>> c2=c1.capitalize() >>> print(c2) Welcome to my python 统计出现次数…