函数
- 初识
def say_hello ():
print('hello~')
say_hello()
- 带参数
def say_hello (msg):
print(msg)
say_hello('hello~')
- 默认参数
def say_hello (msg='hello~'):
print(msg)
say_hello()
say_hello('python')
def say_hello ():
print('hello~')
say_hello()
def say_hello (msg):
print(msg)
say_hello('hello~')
def say_hello (msg='hello~'):
print(msg)
say_hello()
say_hello('python')