From e6a76ddd3d0d8faaef51e6bdab50e92c9d8bc6df Mon Sep 17 00:00:00 2001 From: prjailani <76675034+prjailani@users.noreply.github.com> Date: Thu, 7 Oct 2021 18:54:15 +0530 Subject: [PATCH] Pattern * Print a right angled star pattern using * --- Python/pattern.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Python/pattern.py diff --git a/Python/pattern.py b/Python/pattern.py new file mode 100644 index 00000000..88090386 --- /dev/null +++ b/Python/pattern.py @@ -0,0 +1,12 @@ +# Python 3.x code to demonstrate star pattern + +# Function to demonstrate printing pattern +def pypart(n): + myList = [] + for i in range(1,n+1): + myList.append("*"*i) + print("\n".join(myList)) + +# Driver Code +n = 5 +pypart(n)