Skip to content

Commit 33edbf8

Browse files
Merge pull request #1838 from sundaram2021/patch-7
modified pattern5.py
2 parents 24070ea + a19359f commit 33edbf8

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

Patterns/pattern5.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66
#54321
77

88
def main():
9-
lines = int(input("Enter number of lines: "))
9+
lines = int(input("Enter the number of lines: "))
1010
pattern(lines)
1111

1212
def pattern(rows):
13-
14-
15-
for row in range(1, rows):
16-
for column in range(row, 0, -1):
17-
print(column, end=' ')
18-
print("")
19-
20-
21-
13+
for i in range(1, rows+1):
14+
for j in range(i, 0, -1):
15+
print(j, end="")
16+
print()
2217

2318
if __name__ == "__main__":
24-
main()
19+
main()

0 commit comments

Comments
 (0)