×

Python Tutorial

Python Basics

Python I/O

Python Operators

Python Conditions & Controls

Python Functions

Python Strings

Python Modules

Python Lists

Python OOPs

Python Arrays

Python Dictionary

Python Sets

Python Tuples

Python Exception Handling

Python NumPy

Python Pandas

Python File Handling

Python WebSocket

Python GUI Programming

Python Image Processing

Python Miscellaneous

Python Practice

Python Programs

Python program to call a function using keyword argument

Here, we will write a Python program to call a function using keyword argument which allows us to change the order of arguments. By Shivang Yadav Last updated : January 05, 2024

Python function is a block of code which does a specific operation and can be called from anywhere in the code. Also, function accepts values i.e. argument to work upto.

Python also supports keyword Argument. This allows the programmer to change position on passing arguments. This is done using keyword argument.

Program to call a function using keyword augment

def show(id="<no id>",name="<no name>"):
    print("Your id is :",id,"and your name is :",name)

show(12,"deepak")
show(name = "priya",id = 34)

Output

The output of the above program is:

Your id is : 12 and your name is : deepak
Your id is : 34 and your name is : priya

To understand the above program, you should have the basic knowledge of the following Python topics:

Python Basic Programs »

Advertisement
Advertisement

Related Programs

Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.