We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 104c5ff commit e511b26Copy full SHA for e511b26
Programs/P05_Pattern.py
@@ -88,3 +88,24 @@ def pattern5(level):
88
print()
89
pattern5(userInput)
90
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])
0 commit comments