class shape:
def __init__(self):
self.letter = "ZYXWVUTSRQPONMLKJIHGFEDCBABCDEFGHIJKLMNOPQRSTUVWXYZ"
def run(self, n, m):
for i in range(n):
print(self.letter[25 - i:25 + m - i])
# print(self.letter[25])
if __name__ == '__main__':
n, m = map(int, input().split())
shape = shape()
shape.run(n, m)
蓝桥杯练习题 —— 字母图形(python)
![](https://img-home.csdnimg.cn/images/20240711042549.png)