how to make an input loop in python code example

Example 1: how to make inputs in a loop in python

for i in range(1,6): 
    globals()['string%s' % i] = input("Enter something: ")
    
#You can change how many times the loop iterates

print(string3)#This will return whatever was inputed
			  #in the third iteration of the loop

Example 2: taking input in for loop in python

n, m = list(map(int, input().split()))
arr = []
for _ in range(n):
    l = list(map(int, input().split()))[:m]
    arr.append(l)