Skip to content

Commit 2c387b4

Browse files
Update 100+ Python challenging programming exercises.txt
Added a challenge from hackerrank (30 Days of Code) that is quite easy for anyone.
1 parent 478f4df commit 2c387b4

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

100+ Python challenging programming exercises.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,5 +2371,42 @@ solutions=solve(numheads,numlegs)
23712371
print solutions
23722372

23732373
#----------------------------------------#
2374+
Level: Easy
2375+
2376+
Question:
2377+
Given an integer n, print its first 10 multiples. Each mutiple should be printed on a new line.
2378+
2379+
(Credit: HackerRank (30 Days of Code))
2380+
2381+
Example:
2382+
2383+
n = 2
2384+
2385+
2 x 1 = 2
2386+
2 x 2 = 4
2387+
2 x 3 = 6
2388+
2 x 4 = 18
2389+
2 x 5 = 10
2390+
2 x 6 = 12
2391+
2 x 7 = 14
2392+
2 x 8 = 16
2393+
2 x 9 = 18
2394+
2 x 10 = 20
2395+
2396+
Answer:
2397+
2398+
import math
2399+
import os
2400+
import random
2401+
import re
2402+
import sys
2403+
2404+
# Imports not necessary but provided
2405+
2406+
if __name__ == '__main__':
2407+
n = int(input().strip())
2408+
for i in range(1,11):
2409+
print(n,"x",i,"=",n*i)
2410+
#----------------------------------------#
23742411

23752412

0 commit comments

Comments
 (0)