Write a python program to print following pattern on screen.
*
***
*****
*******
Answers
Answered by
2
Answer:
Program to print inverted half pyramid using an asterisk (star)
Let's start....
print("Program to print half pyramid: ")
rows = input("Enter number of rows ")
rows = int (rows)
for i in range (rows,0,-1):
for j in range(0, i + 1):
print("*", end=' ')
print("\r")
Hope You UNDERSTOOD CLEARLY.
Therefore mark as BRAINLIEST.
THANK YOU.
Answered by
1
Pattern by the Python Programming language
Explanation:
#set variable and initialize to 1
t = 1
#set for loop for row
for r in range(0, 4):
#set another for loop for column
for c in range(0, t):
#print the following output with space
print("*", end=" ")
#increament in the variable for column
t = t + 2
#break line
print('\n')
Following are the description of the program:
- Firstly, set variable 't' and initialize to 1 in it.
- Set the two for loop, the first for loop is for the row that is 4 and the second for loop is for the column that is 7.
- Then, we print the "*" with space and then, we increment in the variable 't' for the column and break the line after the inner loop.
Learn More:
brainly.in/question/13541685
Similar questions
Math,
5 months ago
Biology,
5 months ago
Math,
5 months ago
Math,
9 months ago
Social Sciences,
11 months ago
Social Sciences,
11 months ago
Biology,
11 months ago