#命名、变量、代码、函数
#this one is like your scripts with argv
def print_two(*args):
arg1, arg2 = args #将参数解包
print(f"arg1: {arg1}, arg2: {arg2}")
'''
(*args) 里面*的意思:告诉Python把所有的参数都接收进来,放到名叫args的列表中去
''' #ok,that's *agrs is actually pointless(无意义的),we can just do this
def print_two_again(arg1, arg2):
print(f"arg1: {arg1}, arg2: {arg2}") #this just takes one argument
def print_one(arg1):
print(f"arg1: {arg1}") #this one takes no arguments
def print_none():
print("I got nothin'.") print_two("Zed","Shaw") #不带引号会出错,但是数字可以不带引号
print_two_again("Zed","Shaw")
print_one("First!")
print_none()
05-11 22:00