字符串_合并:
string.join(seq)
以 string 作为分隔符,将 seq 中所有的元素(的字符串表示)合并为一个新的字符串
编码:
tring.encode(encoding='UTF-8', errors='strict')
以 encoding 指定的编码格式编码 string,如果出错默认报一个ValueError 的异常,除非 errors 指定的是'ignore'或者'replace'
解码:
bytes.decode(encoding='UTF-8', errors='strict')
以 encoding 指定的编码格式解码 string,如果出错默认报一个 ValueError 的 异 常 , 除 非 errors 指 定 的 是 'ignore' 或 者'replace'
函数
定义:
def 函数名([参数]):
代码块
[return 表达式]
调用:
函数名([参数])

四种类型:
根据是否有参数和是否有返回值,函数分为4种类型
无参,无返回值

无参,有返回值

有参,无返回值

有参,有返回值

return的介绍:

函数的嵌套:

可变不可变的参数:

网友评论