函数的定义与调用

# _*_ coding: utf-8 _*_

# 定义函数的三种方式
# 有参函数
# def function0(x):
# print('%s' % (x + 1))
#
# function0(2)

# 无参函数
# def function1():
# print('hello world')
#
# function1()

# 空函数
'''
def registration():
pass
def login():
pass
def exit():
pass
def shoppint():
pass
'''


# 函数调用的三种形式
# 1
# registration() 直接调用函数名

# 2
# def max2(x, y):
# if x > y:
# print(type(x))
# return x
# else:
# return y

#
# res = max2(7, 1) * 12 #直接在表达式中使用
# print(res)

# 3
# res = max2(max2(10,20),30)
# print(res)
原文地址:https://www.cnblogs.com/OutOfControl/p/9703020.html