+ 1

# How to print perfect triangle of numbers 1 to 100 ?

Python pattern printing

19th May 2022, 2:52 PM
alagammai uma
21st May 2022, 10:34 AM
James
+ 3
I don't understand yet how the numbers should be arranged but you might want to do something like that? https://techpluslifestyle.com/technology/triangle-shape-in-JUMP_LINK__&&__python__&&__JUMP_LINK/
19th May 2022, 3:18 PM
Lisa
+ 2
alagammai uma printing to 101 might be too big for small screens and would result in line breaks. also, use this: for i in range(1, 5): row = str(i)+" " print(" "*(5-i)+row*(i))
21st May 2022, 7:28 AM
Bob_Li
+ 1
alagammai uma It looks like you're being a bit too vague in your programming. Like right now, you're only telling the computer to print out numbers with a space at the end and beginning.
19th May 2022, 3:10 PM
Justice
+ 1
By "perfect triangle" do you mean a) equilateral triangle b) triangle with perimeter equal to its area? Please give an example
19th May 2022, 3:12 PM
Lisa
+ 1
@lisa equilateral
19th May 2022, 3:13 PM
alagammai uma
+ 1
Lisa pattern needed is of the method 2&3 combination in the link u have sent
19th May 2022, 3:19 PM
alagammai uma
+ 1
Method 2&3 of which section? You can use the given code and adjust it to your needs
19th May 2022, 3:23 PM
Lisa
+ 1
OkLisa thank you
19th May 2022, 3:23 PM
alagammai uma
+ 1
OkBob_Li ok
21st May 2022, 8:42 AM
alagammai uma
0
By using a loop for example. What have you tried so far?
19th May 2022, 2:54 PM
Lisa
0
I tried using 2 loops from 1 to 100 range but it isn't the correct pattern what's needed
19th May 2022, 2:55 PM
alagammai uma
19th May 2022, 2:58 PM
alagammai uma
0
Justice I am beginner to python and I am trying to learn
19th May 2022, 3:12 PM
alagammai uma
0
Me to
21st May 2022, 6:05 AM
Tesfa Micheal Tesfa Tsion Lemma
0
James thank you
21st May 2022, 11:19 AM
alagammai uma