In this python function program, we will create a library management system using a function.
What is Function?
It is a block of code that executes when it is called.
To create a function use def keyword.
Steps to solve the program
- Create a function library.
- Use the def keyword to define the function.
- Pass two parameters i.e. book name and customers name.
- Print the book name and customer name.
- Pass the book name and customer name to the function while calling the function.
def library(bname,cname):
print("Book name: ",bname)
print("Borrowed by :",cname)
library("Harry potter","Atharv")
Output :
Book name: Harry potter
Borrowed by : Atharv
Related Articles
Python function program to add two Binary numbers.
Python function program to search words in a string.
Python function program to get the length of the last word in a string.
Python function program to get a valid mobile number.
Python function program to convert an integer to its word format.
Python function program to get all permutations from a string.