Write a program that prints the following star pattern:
*****
****
***
**
*
for i in range(5, 0, -1):
print('*' * i)
To achieve this, we can use a `for` loop that iterates from 5 down to 1, decrementing by 1 each time. This means it starts at 5 and stops before reaching 0. And for each `for` loop iteration, the number of stars printed varies by `i`.
range(starting_index, ending_index, step_value)
In this case, range(5, 0, -1) means:
starting_index
is 5ending_index
is 0 (exclusive)step_value
is -1 (increase by -1 each iteration)Good luck and happy coding!