From abe96974e2d14710f2e5b09a869ade1435d4f96a Mon Sep 17 00:00:00 2001 From: Heyyayaya <116991476+Heyyayaya@users.noreply.github.com> Date: Mon, 31 Oct 2022 04:14:07 +0530 Subject: [PATCH] Create half-pyramid.py this will be a tricky question because there's a logical part to consider. --- Python/half-pyramid.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Python/half-pyramid.py diff --git a/Python/half-pyramid.py b/Python/half-pyramid.py new file mode 100644 index 0000000..04fa638 --- /dev/null +++ b/Python/half-pyramid.py @@ -0,0 +1,8 @@ +rows = int(input("Enter the number of rows: ")) + +# This will print the rows +for i in range(1, rows+1): + # This will print number of column + for j in range(1, i + 1): + print(j, end=' ') + print("")