star pattern in python

Solutions on MaxInterview for star pattern in python by the best coders in the world

showing results for - "star pattern in python"
Diego Alejandro
03 Jan 2021
1# Python 3.x code to demonstrate star pattern
2 
3# Function to demonstrate printing pattern
4def pypart(n):
5    myList = []
6    for i in range(1,n+1):
7        myList.append("*"*i)
8    print("\n".join(myList))
9 
10# Driver Code
11n = 5
12pypart(n)
13