I was trying to solve this kind of problem, and I filled in the blanks with that thought.
But I don't know what to fill the matrix and append to print the multiplication tables as in the example.ㅠ<
Help a beginner <
python
# Correct answer required by the body
def print_gugudan():
matrix = []
for row in range(2, 10):
matrix.append([])
for column in range(1, 10):
matrix[row - 2].append(row * column)
print(matrix)
I had to organize it according to the template in the question, but it's a little awkward for me to search for an array by designating an index directly like row-2.
I feel comfortable squeezing it like below.
def print_gugudan():
matrix = []
for row in range(2, 10):
result = []
for column in range(1, 10):
result.append(row * column)
matrix.append(result)
print(matrix)
562 Understanding How to Configure Google API Key
565 PHP ssh2_scp_send fails to send files as intended
572 Uncaught (inpromise) Error on Electron: An object could not be cloned
560 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
558 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.