summary refs log tree commit diff stats
path: root/python/code/07_hstarpat.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/code/07_hstarpat.py')
-rw-r--r--python/code/07_hstarpat.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/code/07_hstarpat.py b/python/code/07_hstarpat.py
new file mode 100644
index 0000000..3212851
--- /dev/null
+++ b/python/code/07_hstarpat.py
@@ -0,0 +1,9 @@
+size = int(input('Enter pattern size: '))
+if size < 0:
+    print('Invalid size')
+else:
+    print('*' * size)
+    for i in range(size - 2):
+        print('*' + ' ' * (size - 2) + '*')
+    if size > 1:
+        print('*' * size)