From 2c387b46707ccba7773ec42ee202361057370e4e Mon Sep 17 00:00:00 2001 From: Rohit Barua <83600150+Rohit-beep-droid@users.noreply.github.com> Date: Mon, 24 May 2021 11:31:42 -0400 Subject: [PATCH] Update 100+ Python challenging programming exercises.txt Added a challenge from hackerrank (30 Days of Code) that is quite easy for anyone. --- ...thon challenging programming exercises.txt | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) 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) +#----------------------------------------#