+ 1
How do I print this square pattern?
I'm trying to print a square pattern. The input will be the size of the pattern. For example when inpu(n) is 5, the below pattern should be printed 12345 22345 33345 44445 55555 Here it is what I tried so far :( https://code.sololearn.com/c4NpBPKhuV0q/?ref=app
3 Antworten
+ 5
Perfect!
Thank you guys!
+ 3
Here's a one-liner:
for i in range(1, a := int(input()) + 1): print("".join(map(str, range(i, a))).rjust(a - 1, str(i)))
Edit:
for i in range(1, a := int(input()) + 1): print(str(i) * i, *range(i + 1, a), sep="")
# Hope this helps
0
i want to ask how, do we create link to other page, if im using phone, i create 2 file html, so how can i link to other file hmm