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 07f7428 commit 5de4480Copy full SHA for 5de4480
Patterns/pattern2.py
@@ -13,16 +13,15 @@ def main():
13
pattern(lines)
14
15
def pattern(lines):
16
- t = 0
17
- m = lines + 1
18
- for i in reversed(range(lines+1)):
19
- pattern = "@"*(m)
20
- format = " "*t
21
- t = t + 1
22
- print(format + pattern)
23
- m = m -2
24
- if m <= 0:
25
- exit()
+ for i in range(lines,0,-1):
+ for j in range(lines-i):
+ print(' ', end='')
+
+ for j in range(2*i-1):
+ print('$',end='')
+ print()
26
27
if __name__ == "__main__":
28
main()
0 commit comments