Use PyThon3 function

Code:

def fun1():
    print("hello")
    
def fun2(str):
    str += "!"
    return str
 
def fun3(str="hello!"):
    print(str)
 
def fun4(str1, str2=":", *args):
    print(str1+str2, args)
 
 
if __name__ == '__main__':
    fun1()
    str = fun2("hello")
    print(str)
    fun3("hi!")
    fun3()
    fun4("num",":", 1,2,3,4,5
 

operation result:

hello 
hello! 
hi! 
hello! 
num: ( 1, 2, 3, 4, 5)

 

Guess you like

Origin www.cnblogs.com/jumpkin1122/p/11503245.html