Write a program to print * ** *** **** in python
Answers
Answered by
1
Answer:
def pypart(n):
for i in range(0, n):
for j in range(0, i+1):
# printing stars
print("* ",end="")
# ending line after each row
print("\r")
# Driver Code
n = 4
pypart(n)
Answered by
1
Question:-
Write a program in Python to print the pattern.
*
**
***
****
Program:-
Using 2 loops.
n=int(input("Enter the number of rows: "))
for i in range(1,n+1):
for j in range(0,i):
print("*", end="")
print()
Using 1 loop.
n=int(input("Enter the number of rows: "))
for i in range(1,n+1):
print("*"*i)
Similar questions