Q. Write a function to calculate volume of a box with appropriate default values for its parameters .Your function should have the following input parameters:

(a) length of box ;

(b) width of box ;

(c) height of box.

Test it by writing complete program to invoke it.


You can understand by Watching video :-



Answer :-

def vol( l = 1, w = 1 , h = 1 ) :
    return l * w * h

length = int(input("Enter the length : "))
width = int(input("Enter the width : "))
height = int(input("Enter the height : "))

print("volume of box = ", vol( length , width , height ))

Output :-

Enter the length : 5
Enter the width : 2
Enter the height : 3
volume of box =  30

>>>

Enter the length : 84
Enter the width : 69
Enter the height : 75
volume of box =  434700

>>> 

Enter the length : 1
Enter the width : 1
Enter the height : 1
volume of box =  1

>>>


6 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. ABOUT US
    This is Path walla website which help you to make your way of life. This website provide you previous year question paper, python program, Facts, about technology and etc.

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post