函数返回值

def test(x):
"the function definitions"
x += 1
return x
# 为什么要有返回值,需要函数执行的结果

#return x
# x 可以为任意类型,任意个数。。。
# 1.不写return --- > 返回none
# 2.写return 0 ---- > 返回0
# 3.写return 1,"hello",["wang"],{"name":"wang"} --- > 返回元组(1, 'hello', ['wang'], {'name': 'wang'})
# eg :
# def test():
# "the function definitions"
# return 1,"hello",["wang"],{"name":"wang"}
# a = test()
# print (a)


posted @ 2017-12-19 17:20  王瑞良  阅读(149)  评论(0)    收藏  举报