function return value

# -*- coding: utf-8 -*- 
def test1():
print( "test1 return value ")

def test2():
print( "test2 return value ")
return 0

def test3():
print( "test3 return value ")
return 1,[ "a", "b", "c"],{ "name": " He Xiaoliu "}

x=test1()
y=test2()
z=test3()


print(y)
print(z)

#Summary :
#Number of return values =0 , return None #Number
of return values =1 , return object (the object itself)
# return value>1 , returns a tuple (tuple)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324428640&siteId=291194637