python中通过def关键字来定义函数。
Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 15:51:26) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> def add(a,b):
print(a+b)
>>> add(5,5)
10
>>> def add(a,b):
return a+b
>>> add(6,6)
12
>>> def add(a=1,b=2):
return a+b
>>> add()
3
>>> add(5,5)
10
>>>