- 2
Friends help me with this code by using python ??
A B C D E F G H I J print above pattern without using ASCII value .
4 Antworten
+ 3
First show your attempts!!
I can give you hint:
0
1 2
3 4 5
6 7 8 9
make a list or string which contains - "abc....j" , in my pattern you can take numbers as an index .
Else try by your own!
+ 1
Here's a possibility:
c = 0
for i in range(1, 5):
for j in range(i):
print(chr (65+c), end=" ")
c += 1
print()
# Hope this helps
0
S ALI ABID ABIDI Hint: Use the chr () function.
0
Now here's a one-liner:
for i in range(1, 5): print(*map(lambda x: chr (64 + x), range((k := i * (i - 1) // 2 + 1), k + i)))
# Hope this helps