## Python brush questions - letter graphics

DaLongggggg 2021-04-06 15:56:19
python brush questions letter graphics

# Problem description

The use of letters can form some beautiful graphics , Here is an example ：

ABCDEFG

BABCDEF

CBABCDE

DCBABCD

EDCBABC

This is a 5 That's ok 7 The graph of the column , Please find out the law of this figure , And output a n That's ok m The graph of the column .

# Input format

The input line , Contains two integers n and m, The number of columns representing the number of rows of the graph you want to output .

# Output format

Output n That's ok , Every m Characters , For your graphics .

5 7

# Sample output

ABCDEFGBABCDEFCBABCDEDCBABCDEDCBABC

# Data scale and agreement

1 <= n, m <= 26.

``n,m = map(int,input().split(" "))str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"str2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"for i in range(0,n): if i == 0: print(str1[0:m]) else: str1 = str2[i]+str1 print(str1[0:m])``

Because the input requires two numbers + Space, so use a map Call the function to go to the space, input the first line of the main body loop, and call it directly str1 Press enter m Cut the character after splicing output

https://pythonmana.com/2021/04/20210406155134289y.html