forked from AdarshAddee/Hacktoberfest2022_for_Beginers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
starpattern.py
53 lines (43 loc) 路 662 Bytes
/
starpattern.py
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
"""
star pattern : It takes input from the user and produces the star pattern accordingly as given below..
for eg :--
Inout:
Enter the value of n: 5
Output:
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
Enter the value of n: 8
Output:
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * *
* * * * * *
* * * * *
* * * *
* * *
* *
*
"""
n = int(input("Enter the value of n: "))
for i in range(n):
for j in range(0 , i+1):
print("* " , end = "")
print()
for i in range(n-1,0,-1):
for j in range(0 , i):
print("* " , end = "")
print()
print("______________Program Over_______________")