Python function program to create a Fruitshop Management system

In this python function program, we will create a Fruitshop Management system using 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
  1. Create a function fruit.
  2. Use the def keyword to define the function.
  3. Pass three parameters i.e. fruit name, fruit price, and fruit quantity.
  4. Print the fruit name, fruit price, and fruit quantity.
  5. Calculate the total bill by multiplying fruit price and fruit quantity.
  6. Print the bill.
  7. Pass the fruit name, fruit price, and fruit quantity to the function while calling the function.
				
					def fruit(fname,fprice,quantity):
    print("Fruit name: ",fname)
    print("Fruit price: ",fprice)
    print("Fruit quantity in kg: ",quantity)
    print("Bill : ",fprice*quantity)
fruit("Apple",100,2)
				
			

Output :

				
					Fruit name:  Apple
Fruit price:  100
Fruit quantity in kg:  2
Bill :  200
				
			

Related Articles

get the addition with the return statement.

check whether the given year is a leap year.

Leave a Comment