函数 python def functionname(parameters): """函数文档字符串 (docstring),用于描述函数的功能""" # 函数体 - 执行特定任务的代码 return value # 可选的返回值 python describepet('兔子', petname='小白') # 正确:先位置参数,后关键字参数 # describepet(petname='小黑', '乌龟') # 错误:关键字参数不能在位置参数之前 python lambda arguments: expression python help(calculatearea) # 使用 help() 函数查看文档字符串 print(calculatearea.