Check sibling questions

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

 

Answer:

The function will be as follows:

def box_volume (l= 1 ,b= 1 ,h= 1 ):

    vol=l*b*h

    return (vol)

  1. Computer Science - Class 12
  2. Chapter 14 - Functions in python

About the Author

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo