Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. def minimum(*inputs, **number):
  2.     INF = 1e6
  3.     mini = INF
  4.     for eachKey in number.keys():
  5.         print eachKey, number[eachKey]
  6.        
  7.     # one may also directly call built-in function min()
  8.     for each in inputs:
  9.         if mini > each:
  10.             mini = each
  11.  
  12.     return mini
  13.  
  14. def main():
  15.     m = minimum(12, 4, 8, 13, 5, n=5)
  16.     print 'minimum of 5 numbers (12, 4, 8, 13, 5):', m
  17.     inDict = {'n':8}
  18.     m = minimum(*(12, 4, 8, 13, 5, 7, 26, 3), **inDict)
  19.     print 'minimum of 8 numbers (12, 4, 8, 13, 5, 7, 26, 3):', m
  20.  
  21. main()