We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4bcafb6 commit 8d76479Copy full SHA for 8d76479
1 file changed
Programs/P05_Pattern.py
@@ -89,23 +89,24 @@ def pattern5(level):
89
pattern5(userInput)
90
print()
91
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])
+ def pattern6(userInput):
+ '''
+ following is the another approach to solve pattern problems with reduced time complexity
+
+ for
+ *
+ **
+ ***
+ ****
+ *****
+ num = int(input('Enter number for pattern'))
+ pattern = '*'
+ string = pattern * num
+ x = 0
+ for i in string:
+ x = x + 1
112
+ print(string[0:x])
0 commit comments