Skip to content

Instantly share code, notes, and snippets.

@atul-chaudhary
Created September 1, 2019 06:03
Show Gist options
  • Save atul-chaudhary/d9931787f9b937803f4695845ed16933 to your computer and use it in GitHub Desktop.
Save atul-chaudhary/d9931787f9b937803f4695845ed16933 to your computer and use it in GitHub Desktop.
Webkul: Campus placement pattern program (round 1 MIET campus 2016-2020 batch)
#webkul pattern program round 1
#pattern runs for odd number like min 3 , 5, 7 etc
#here is ther pattern
#for n==3
* *
** **
***@@@***
@@@
@@@
***
*
#for n==5
* *
** **
*** ***
**** ****
*****@@@@@*****
@@@@@
@@@@@
@@@@@
@@@@@
*****
***
*
#and so on for n==7.....
#here is the program
n = int(input())
x = (n + n + n) - 2
for i in range(1, n + 1):
for j in range(i):
print('*', end='')
if (i == n):
for _ in range(x):
print('@', end='')
x -= 2
else:
for _ in range(x):
print(end=' ')
x -= 2
for _ in range(i):
print('*', end='')
print()
for _ in range(1, n):
for _ in range(n):
print(end=' ')
for _ in range(n):
print('@', end='')
print()
x = n
k=n
for l in range(x, 0, -1):
for _ in range(k):
print(end=' ')
k += 1
x1 = x
for _ in range(x1):
print('*', end='')
x1 -= 2
x -= 2
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment