I will explain the solution provided by you line by line.
n = int(input().strip()) -> 'input()' allows user to enter any input. '.strip()' removes any accidental extra spaces. 'int()' ensures that the input provided is of integer type only and not some random alphabet or special character.
arr = [] -> it creates an empty array which will store the user input.
for _ in range(n): -> this will create a loop (a task that will run 'n' number of times.
arr.append(list(map(int, input().rstrip().split()))) ->
PARTS OF EXPLANATION:
4.1 You need to input a list everytime the loop runs of any length.
4.2 input() allows you to enter as many numbers as you want (eg: 1 2 3 4 5). Please remember that 'input()' by default treats all input as string type.
4.3 rstrip() makes sure you don't add any extra spaces.
4.4 split() takes all the space separated characters and forms a list. (eg -> "1" "2" "3" -> AFTER SPLIT -> ["1","2","3"].
4.5 map(int, list after split) -> makes sure that all elements in the list are valid integers and converted to int type from string type.
4.6 arr.append(list) -> This adds the list of numbers (one row) to the main list arr.
I hope that my solution made it easier for you to understand.
(PS: Always add the question number you are referring to.)
All the best!