Naming, Variables, Code and Functions

#coding=gbk
#coding=utf-8

#Define function 
def print_two (* args):
     #Define formal parameters 
    arg1, arg2 = args
     print ( " arg1: %r,arg2: %r " % (arg1,arg2))
 #Pass in actual parameters 
print_two( " a " , " b " )

def print_one():
    print("I LOVE PYTHON")
print_one()
1.def print_two(* args): means "tell python to receive all the parameters of the function and put them in a list named args" 
2. Function naming rules: the same as variable names, just start with letters , a number and an underscore, and it does not start with a number

Guess you like

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