-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyramid
More file actions
30 lines (27 loc) · 850 Bytes
/
pyramid
File metadata and controls
30 lines (27 loc) · 850 Bytes
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
#P4. WAP to print isosceles triangle using any character as user input.
def pyramid(symbol):
'''
Objective : To print pyramid
Input Parameters :
symbol : User entered symbol for printing pyramid
Return Value : None
'''
#approach: using print function to print strings of user entered symbol
print(" ",symbol)
print(" ",symbol,symbol)
print(" ",symbol,symbol,symbol)
print(" ",symbol,symbol,symbol,symbol)
print(" ",symbol,symbol,symbol,symbol,symbol)
def main():
'''
Objective : To print pyramid
User Inputs :
symbol : User entered symbol for printing pyramid
'''
#approach: To use pyramid function
symbol = input('Enter Symbol : ')
pyramid(symbol)
print('Main Ends..!')
if __name__ == '__main__':
main()
print('Program Ends..!')