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.
2 parents c5dab9e + cb12a3d commit b07ccbaCopy full SHA for b07ccba
Patterns/patterns.py
@@ -19,21 +19,11 @@ def main():
19
pattern(lines)
20
21
def pattern(lines):
22
+ for i in range(1,lines+1):
23
+ print("* "*i)
24
+ print()
25
for i in range(lines):
- for j in range(i+1):
- print("* ", end="")
- print("")
26
- print(" ")
27
-
28
- for i in range(0,lines):
29
30
- for j in range(0, (2 * (i - 1)) + 1):
31
- print(" ", end="")
32
33
- for j in range(0, lines - i):
34
- print("*", end=" ")
35
36
+ print(" "*i,"* "*(lines-i))
37
38
if __name__ == "__main__":
39
main()
0 commit comments