From c9dfd2b77fe02450e2c4cc85957bb2c8de12ee0d Mon Sep 17 00:00:00 2001 From: Prashans Dixit <71697179+prishuprograms@users.noreply.github.com> Date: Thu, 1 Oct 2020 15:17:31 +0530 Subject: [PATCH 1/2] Star Pattern --- Pattern.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Pattern.py diff --git a/Pattern.py b/Pattern.py new file mode 100644 index 0000000..dc84582 --- /dev/null +++ b/Pattern.py @@ -0,0 +1,7 @@ +import tensorflow as tf + +n =5 +for x in list(range(n)) + list((reversed(range(n-1)))): + a = n-x-1 + b = x*2+1 + print('{: <{w1}}{:*<{w2}}'.format('', '', w1 = a, w2 = b)) \ No newline at end of file From 34f0cdbf2b005803e30483cd60644668c922d1de Mon Sep 17 00:00:00 2001 From: Prashans Dixit <71697179+prishuprograms@users.noreply.github.com> Date: Thu, 1 Oct 2020 15:18:11 +0530 Subject: [PATCH 2/2] Updated Code.. --- Pattern.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Pattern.py b/Pattern.py index dc84582..9bfdc76 100644 --- a/Pattern.py +++ b/Pattern.py @@ -1,7 +1,6 @@ -import tensorflow as tf n =5 for x in list(range(n)) + list((reversed(range(n-1)))): a = n-x-1 b = x*2+1 - print('{: <{w1}}{:*<{w2}}'.format('', '', w1 = a, w2 = b)) \ No newline at end of file + print('{: <{w1}}{:*<{w2}}'.format('', '', w1 = a, w2 = b))