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


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0