python里边的一个*指的是元祖
def f(*lt):
print(lt)
lt = list(range(1,11))
f(lt) # ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],)
dic = {1:2,3:4,5:6}
f(dic) # ({1: 2, 3: 4, 5: 6},)
tup = (1,2,3,4,5)
f(tup) # ((1, 2, 3, 4, 5),)
f(1,2,3,4,5) # (1, 2, 3, 4, 5)
python里边的一个*指的是元祖
def f(*lt):
print(lt)
lt = list(range(1,11))
f(lt) # ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],)
dic = {1:2,3:4,5:6}
f(dic) # ({1: 2, 3: 4, 5: 6},)
tup = (1,2,3,4,5)
f(tup) # ((1, 2, 3, 4, 5),)
f(1,2,3,4,5) # (1, 2, 3, 4, 5)