






Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Esta página não é visível na pré-visualização
Não perca as partes importantes!







Nitya Cloudtech
Usage: Allows a function to accept an arbitrary number of positional arguments. How it works: All additional positional arguments are collected into a tuple. (1,2,4,5,8,11,123)
and We want to add 2 more keys like Age, Salary for that we have to add 2 more paraments and for 10 fields ->10 Parameters and assign the values def record(x,i,y,j,z,): d={} d[x]=i d[y]=j
print(d)
def record(**kwargs): print(kwargs) record(Name="Aditya",Exp="11 Years",Age=30,Salary=98000)
{'Name': 'Aditya', 'Exp': '11 Years', 'Age': 30, 'Salary': 98000}
def func(fargs,args,kwargs):* def func(fargs,args,*kwargs): print(fargs,args,kwargs) func('1st',' Second', 'Third', Fourth=4, Fifth=5) Output: 1st ('Second', 'Third') {'Fourth': 4, 'Fifth': 5}
FOR CAREER GUIDANCE, CHECK OUT OUR PAGE