#_*_ encoding: utf-8 _*_ @author: ty hery 2019/9/6
def table_things(**kwargs):
for name, value in kwargs.items():
print ('{0} = {1}'.format(name, value))
table_things(apple = 'fruit', cabbage = 'vegetable')
输出:
apple = fruit
cabbage = vegetable
#_*_ encoding: utf-8 _*_ @author: ty hery 2019/9/6
def print_three_things(a, b, c):
print ('a = {0}, b = {1}, c = {2}'.format(a,b,c))
mylist = ['aardvark', 'baboon', 'cat']
print_three_things(*mylist)
mylist2 = ('aardvark', 'baboon', 'cat')
print_three_things(*mylist)
print_three_things(a = 'aardvark', b = 'baboon', c = 'cat')
输出:
a = aardvark, b = baboon, c = cat
a = aardvark, b = baboon, c = cat
a = aardvark, b = baboon, c = cat