61 Program to demonstrate keyword and non-keyword argument in Python

Program:

def emp(eid,ename,sal,dno,city="hyd"):

    print(eid,ename,sal,dno,city)



emp(101,"miller",20000,11,"hyd")

emp(sal=30000,dno=12,city="pune",eid=102,ename="john")

#emp(40000,13,"mumbai",103,"James")


Output:

Program to demonstrate keyword and non-keyword argument in Python

Previous
Next Post »