python def的函数运行吗

如题所述

可以运行的,def是自定义函数。
比如:
def add(x, y):
print "x is {0} and y is {1}".format(x, y)
return x + y
调用方法:
add(1,2)
温馨提示:答案为网友推荐,仅供参考