File tree Expand file tree Collapse file tree 1 file changed +21
-20
lines changed Expand file tree Collapse file tree 1 file changed +21
-20
lines changed Original file line number Diff line number Diff line change @@ -89,23 +89,24 @@ def pattern5(level):
8989 pattern5 (userInput )
9090 print ()
9191
92- '''
93- following is the another approach to solve pattern problems with reduced time complexity
94-
95- for
96-
97- *
98- **
99- ***
100- ****
101- *****
102- '''
103-
104- num = int (input ('Enter number for pattern' ))
105- pattern = '*'
106- string = pattern * num
107- x = 0
108-
109- for i in string :
110- x = x + 1
111- print (string [0 :x ])
92+ def pattern6 (userInput ):
93+ '''
94+ following is the another approach to solve pattern problems with reduced time complexity
95+
96+ for
97+
98+ *
99+ **
100+ ***
101+ ****
102+ *****
103+ '''
104+
105+ num = int (input ('Enter number for pattern' ))
106+ pattern = '*'
107+ string = pattern * num
108+ x = 0
109+
110+ for i in string :
111+ x = x + 1
112+ print (string [0 :x ])
You can’t perform that action at this time.
0 commit comments