Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Patterns/Floyd's_Triangle
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Python 3 Program - Print Floyd Triangle

#Floyd triangle using for loop

ran = input("Upto how many line ? ")

rang = int(ran)
k = 1
for i in range(1, rang+1):
rows = int(input("Enter the number of rows for Floyd's Triangle: "))
number = 1
for i in range(1, rows+1):
for j in range(1, i+1):
print(k, end=" ")
k = k + 1
print(number, end=" ")
number += 1
print()