-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
76 lines (61 loc) · 1.16 KB
/
Copy pathmain.py
File metadata and controls
76 lines (61 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# To check if input is Prime Number
'''
n = int(input('Enter a number'))
if n > 1:
for i in range(2,n//2):
if n%i == 0:
print(n,'is not a Pime number')
break
else:
print(n,'is prime number')
else:
print('Invalid Input')
'''
# To Find Factorial of a number
'''
n = int(input('Enter the number'))
facto = 1
if n == 1:
print('Factorial: 1')
elif n==0 or n < 0 :
print('Factorial: 0')
else:
for i in range(2,n+1):
facto*=i
print(facto)
'''
# To print the Fibonacci Series
'''
a = 0
b = 1
n = int(input('Enter the no of series: '))
i = 1
while i <= n:
print(a, end=' ')
a,b = b, a+b
i+=1
'''
n = int(input())
r_arr =1
for j in range(1,n):
print(' '*(n*4),end='')
print('* '*r_arr)
r_arr+=1
r_arr = n
for i in range(1,n+1):
print(' '*(n-i),end='')
print('* '*i,end='')
if i == n:
print('e '*n,end='')
else:
print(' '*n,end='')
print('* '*n,end='')
if i == 1:
print('e '*n,end='')
else:
print(' '*n,end='')
print('* '*r_arr)
r_arr-=1
for i in range(1,n):
print(' '*i,end='')
print('* '*(n-i))