Skip to content

Instantly share code, notes, and snippets.

@gauravssnl
Created May 5, 2017 16:56
Show Gist options
  • Save gauravssnl/3c4a0606f62397cc1e08aa8e465451ee to your computer and use it in GitHub Desktop.
Save gauravssnl/3c4a0606f62397cc1e08aa8e465451ee to your computer and use it in GitHub Desktop.
pattern
""" Output Sample:
1 A
1 2 B
1 2 3 C
1 2 3 4 D
1 2 3 4 5 E
1 2 3 4 5 6 F
1 2 3 4 5 6 7 G
1 2 3 4 5 6 7 8 H
1 2 3 4 5 6 7 8 9 I
1 2 3 4 5 6 7 8 9 10 J
1 2 3 4 5 6 7 8 9 10 11 K
1 2 3 4 5 6 7 8 9 10 11 12 L
1 2 3 4 5 6 7 8 9 10 11 12 13 M
1 2 3 4 5 6 7 8 9 10 11 12 13 14 N
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 O
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 P
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Q
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 R
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 S
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 T
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 U
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 V
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 W
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 X
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Y
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Z
"""
l = [chr(x) for x in range(65,91)]
for i in range(1,27):
for j in range(1,i+1):
print(j,end=" ")
print(l[i-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment