diff --git a/Challenge questions/neil-dev/challenge7.py b/Challenge questions/neil-dev/challenge7.py new file mode 100644 index 0000000..68c26c4 --- /dev/null +++ b/Challenge questions/neil-dev/challenge7.py @@ -0,0 +1,21 @@ +dimension = input('Enter the length and breadth: ') +length,breadth = dimension.split() +break_point = (int(length) - 1) // 2 +count = 1 +if int(length) % 2 == 0: + count = 2 + +change = 1 +for i in range(int(breadth)): + if int(length) < int(breadth) and (i < (int(breadth) - int(length) + 1) // 2 or count <= 0): + print('#' * int(length)) + continue + print(('#' * break_point) + ('~' * count) + ('#' * break_point)) + if i == (int(breadth)-1) // 2: + change = -1 + if int(breadth) % 2 == 0 and i == (int(breadth)-1) // 2: + # print(count) + continue + break_point = break_point - change + count = count + 2 * change + \ No newline at end of file