diff --git a/100+ Python challenging programming exercises.txt b/100+ Python challenging programming exercises.txt index 97af5aaf..e4f7cfcc 100644 --- a/100+ Python challenging programming exercises.txt +++ b/100+ Python challenging programming exercises.txt @@ -2371,5 +2371,42 @@ solutions=solve(numheads,numlegs) print solutions #----------------------------------------# +Level: Easy + +Question: +Given an integer n, print its first 10 multiples. Each mutiple should be printed on a new line. + +(Credit: HackerRank (30 Days of Code)) + +Example: + +n = 2 + +2 x 1 = 2 +2 x 2 = 4 +2 x 3 = 6 +2 x 4 = 18 +2 x 5 = 10 +2 x 6 = 12 +2 x 7 = 14 +2 x 8 = 16 +2 x 9 = 18 +2 x 10 = 20 + +Answer: + +import math +import os +import random +import re +import sys + +# Imports not necessary but provided + +if __name__ == '__main__': + n = int(input().strip()) + for i in range(1,11): + print(n,"x",i,"=",n*i) +#----------------------------------------#