Tuesday, 19 February 2019

Python Functions - def, *args and **kwargs



def pirnt_num(*numbers):
    print(numbers)

pirnt_num(2,3,4,5)

(2, 3, 4, 5)

def save_user(**user):
    print(user)

save_user(id=1, name='John', age=22)

{'id': 1, 'name': 'John', 'age': 22}


No comments:

Post a Comment