search

Home  >  Q&A  >  body text

Write a function that can print m*n character matrix and m*m square character pattern

Write a function that can print m*n character matrix and m*m square character pattern.

def print_rectangle(row: int = 5, column: int = 5, char: str = '*') -> None:

"""

Print Output matrix graphic

:param row: Number of rows

:param column: Number of columns

:param char: Characters used in the graphic

:return: None

"""

# Please add the code here to complete this task

#************ Begin ****** ***

# #********** End *********

# return

##def print_square(row: int = 5, char: str = '*') -> None:

"""

Print out the square graphic

:param row: The number of rows in the square

:param char: The characters used in the graphic

:return: None

"""

# Please add the code here to complete this task

#********** Begin *********

# print_rectangle()

#************ End *********

# shape = input().split()

m = int(shape[0])

n = int(shape[1])

print_rectangle(row=m, column=n)

print_square(row=m)

1665 days ago1128

reply all(0)I'll reply

No reply
  • Cancelreply