Using default arguments. : Function as Parameters : Function PYTHON examples


PYTHON examples » Function » Function as Parameters »

 

Using default arguments.


 

def boxVolumelength = 1, width = 1, height = ):
   return length * width * height

print "The default box volume is:", boxVolume()
print "nThe volume of a box with length 10,"
print "width 1 and height 1 is:", boxVolume10 )
print "nThe volume of a box with length 10,"
print "width 5 and height 1 is:", boxVolume10)
print "nThe volume of a box with length 10,"
print "width 5 and height 2 is:", boxVolume105)

   
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Function
» Function as Parameters