Robotics & Artificial Intelligence
Write Python code to display the following pattern:
5
5 4
5 4 3
5 4 3 2
5 4 3 2 1
Python Control Flow
1 Like
Answer
for i in range(1, 6):
for j in range(5, 5 - i, -1):
print(j, end=" ")
print()Output
5
5 4
5 4 3
5 4 3 2
5 4 3 2 1
Answered By
3 Likes
Related Questions
Write Python code to display the following pattern:
5 4 3 2 1 5 4 3 2 5 4 3 5 4 5Write Python code to display the following pattern:
1 3 5 7 9 1 3 5 7 1 3 5 1 3 1Write Python code to display the following pattern:
1 3 5 5 7 9 7 9 11 13 9 11 13 15 17Write Python code to display the following pattern:
1 2 3 4 5 2 3 4 5 3 4 5 4 5 5