- 10

How to write a program to print 1 12 123 1234 12345

16th Jun 2019, 5:03 PM
abinithiabi
13 Answers
+ 8
have you learn how to use loop, learn that and you won't ask people to do that for you
16th Jun 2019, 5:17 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
+ 6
[[print((n==i+1)*' ' or n, end='') for n in range(1, i+2)] for i in range(1, 6)] šŸ‘†
16th Jun 2019, 5:23 PM
Anna
Anna - avatar
+ 5
for i in range(1,7): for j in range(1,i): print(j) j+=1 print() i+=1
16th Jun 2019, 6:03 PM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar
+ 3
while loops šŸ˜„ n = "1" j = 1 while n != "123456": print(n, end=ā€œ ā€) j += 1 n += str(j) simple one liner: n = "".join([str(j)+" "if j+1==i else str(j)for i in range(1,6) for j in range(1,i)])
16th Jun 2019, 7:11 PM
Choe
Choe - avatar
+ 1
for x in range(1, 5): print("". join([*map(str, range(1, x) ) ] ), end=" " )
17th Jun 2019, 6:16 AM
alex_shchegretsov
alex_shchegretsov - avatar
+ 1
n = 10 for i in range(1,n+1): for j in range(1, i+1): print(j, end=' ') print('')
23rd Dec 2021, 5:05 AM
SHANKHA
0
for i in range(1, 6) : for j in range(1, i+1) : print (j, end=" ") print ()
22nd Jun 2019, 7:31 AM
Muskan Singh
Muskan Singh - avatar
0
i=1 while(i<6): for j in range(1,i): print(j,end='\t') print(end='\t') i+=1
19th Jul 2019, 3:17 PM
abinithiabi
0
How to write print the number 12345 1234 123 12 1
12th Feb 2020, 5:55 PM
Harsimran Singh
Harsimran Singh - avatar
0
aaah its difficult oops i am seaching help wooo
11th Nov 2020, 8:11 PM
Newman Mucheki
Newman Mucheki - avatar