#MonthOfCode day 14 - loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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