*args and **kwargs Concepts In Python

 


## Practice it in your editor to learn it by doing it:---------

## About *args:---


def myfunc1(f_args,*args):
    print("Firrst normal argument:-",f_args)
    for arg in  args:
        print("Another Normal Argument:-",arg )
if __name__=="__main__":
    
    myfunc1("Family Members","Aamir","Alina","Danish","Uzma","Mantasha")




## About **kwargs:---


def myfunc(**kwargs):
    for kw in kwargs:
        print(kw,":-",kwargs[kw] )
if __name__=="__main__":
    myfunc(a="Aamir",b="Danish",c="Alina",d="Tausif")




## Output Of *args :-
a :-Aamir b :- Danish c :- Alina d :- Tausif




## Output Of **kwargs:-
Myself=Aamir Brother=Danish Sister=Alina Brother2=Tausif


Comments

Popular posts from this blog

XAMPP, SQL BASIC COMMANDS

The Minion Game Hackerrank Solution

Arrays - DS | HackerRank Solutions