8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c22d68 commit 609441dCopy full SHA for 609441d
patterns/FloydsTriangle.py
@@ -1,15 +1,27 @@
1
__author__ = 'Avinash'
2
3
+# Print a Floyd's Triangle
4
+
5
+# Range of the triangle
6
size = int(input("Enter the range: \t "))
7
8
+print("\nFLOYD'S TRIANGLE with numbers: \n")
9
k = 1
10
11
+# 2 for loops, one for column looping another for row looping
12
+# i loop for column looping and j loop for row looping
13
for i in range(1, size + 1):
14
for j in range(1, i + 1):
15
print(k, end=" ")
16
k = k + 1
- print("\n")
17
+ print()
18
+print("\n")
19
20
21
+# Print using *'s
22
+print("\nFLOYD'S TRIANGLE with *'s: \n")
23
24
25
print('*', end=" ")
26
27
0 commit comments