Skip to content

Instantly share code, notes, and snippets.

@wkta
Created March 18, 2014 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wkta/9615487 to your computer and use it in GitHub Desktop.
Save wkta/9615487 to your computer and use it in GitHub Desktop.
#MonthOfCode day 14 - loop
from __future__ import print_function
import sys
def printMultiples(k, sup_bound):
map(print, [ k*i for i in xrange(1,1+(sup_bound/k) ) ] )
if (len(sys.argv)<3 ):
print("this program prints multiples of k up to a cernain bound")
print("usage: python "+sys.argv[0]+" k sup_bound")
sys.exit(1)
printMultiples( int(sys.argv[1]), int( sys.argv[2]) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment