函数

python def sayhi(name):

def 函数头

sayhi函数名

name参数

:函数头必须以:为结尾

python def Sayhi(name,greet='hello'):

含默认值的参数必须放在无默认值的参数后面

```python def shop(where='shop',what='patsa'): print(where,what)

# 使用函数 shop(where='store') ```

使用关键字函数的优点: