**New course!**Every coder should learn

**Generative AI!**

- 10

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

11 Answers

+ 8

have you learn how to use loop, learn that and you won't ask people to do that for you

+ 6

[[print((n==i+1)*' ' or n, end='') for n in range(1, i+2)] for i in range(1, 6)] 👆

+ 5

for i in range(1,7):
for j in range(1,i):
print(j)
j+=1
print()
i+=1

+ 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)])

+ 1

for x in range(1, 5):
print("". join([*map(str, range(1, x) ) ] ), end=" " )

+ 1

n = 10
for i in range(1,n+1):
for j in range(1, i+1):
print(j, end=' ')
print('')

0

for i in range(1, 6) :
for j in range(1, i+1) :
print (j, end=" ")
print ()

0

i=1
while(i<6):
for j in range(1,i):
print(j,end='\t')
print(end='\t')
i+=1

0

How to write print the number
12345
1234
123
12
1

0

aaah its difficult oops i am seaching help wooo