函数方法python 函数方法求三个数最大值( 二 )


# decode() 解码字符串
# dict.keys() 获取字典所有的键
# find()字符串首次出现的索引
# f.read() 读取文件内容
# dict.update()更新字典
# dict.items() 获取字典键/值对
# dict.get() 返回指定键的值
# encode() 编码字符串
# list.sort() 排序列表元素
# index() 元素首次出现的索引
# isdigit() 判断字符串是否只由数字组成
# isupper() 是否所有字母都为大写
# isnum() 判断字符串是否由字母和数字组成
# islower() 是否所有字母都为小写
# isdecimal() 检查字符串是否只包含十进制字符
# isalpha() 检测字符串是否为纯字母
# random.shuffle()随机排序
# random.sample()返回无重复随机数列表
# random.choice() 返回一个随机元素
# random.randint() 生成指定范围的随机整数
# random.randrange() 生成指定范围的指定递增基数随机整数
# pop() 删除列表中的元素
# remove()删除列表中的指定元素
# strip()去除空格
# lstrip()去除左侧空格
# rstrip() 去除右侧空格
# readline() 读取单行内容
# root.after() Tkinter中等待一段时间后再执行命令
# str.isnumeric() 验证字符串是否为数字(适用于Unicode)
# split()分割字符串
# ord() 将字符转换为整数
# replace() 字符串替换
# ljust() 左对齐填充
# rjust() 左对齐填充
# readlines() 读取所有行内容
# datetime.datetime.now() 返回指定时区的本地日期时间
# datetime.datetime.today() 获取当前本地日期的date对象
# datetime.utcnow() 返回当前UTC时间的datetime对象
# time.strptime()把时间字符串解析为元组
# time.time()返回当前时间的时间戳
# time.sleep()暂停指定秒数
# time.strftime() 返回指定格式的日期字符串
# time.mktime() 接收时间元组并返回时间戳
# os.getcwd() 获取当前工作目录
# os.listdir() 获取指定路径下的目录和文件列表
# os.makedirs() 递归创建目录
# os.rename() 重命名目录或文件
# os.path.exists() 判断路径是否存在
# upper() 全部转换为大写字母
# lower()全部转换为小写字母
# sys.stdout.write() 标准输出打印
# sys.stdout.flush()刷新输出
# shutil.copy() 复制单个文件到另一文件或目录
# write() 写入文件内容
# winsound.Beep() 打开电脑扬声器
# zfill() 在字符串前面填充0
三、循环语句
# break终止当前循环
# continue 终止本循环进入下一次循环
# with open() as file 以with语句打开文件(数据保存)
四、转义字符
\行尾续行符
\' 单引号
\'' 双引号
\a 响铃
\e 转义
\n 换行
\t 横向制表符
\f 换页
\xyy 十六进制yy代表的字符
\\反斜杠符号
\b 退格
\000 空
\v 纵向制表符
\r 回车
\0yy 八进制yy代表的字符
\other 其他的字符以普通格式输出
python 方法和函数的区别在Python中函数方法python,对这两个东西有明确的规定:
函数function —— A series of statements which returns some value to a caller. It can also be passed zero or more arguments which may be used in the execution of the body.
方法method —— A function which is defined inside a class body. If called as an attribute of an instance of that class, the method will get the instance object as its first argument (which is usually called self).
从定义的角度上看函数方法python,函数方法python我们知道函数(function)就相当于一个数学公式,它理论上不与其它东西关系,它只需要相关的参数就可以 。所以普通的在module中定义的称谓函数是很有道理的 。

推荐阅读