How to make multiple copies, of printed range functions that are on one line

Very new to python so please excuse!

question is…to make an output look like

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

I am using user input for the limit and the number of copies ( in this example 5 and 3), so I have done this;

limit = int(input(“Select upper limit”))
copies = int(input(“Select number of copies”))

def output(limit):
for i in range(copies):
for x in range(limit):
print (x + 1, end=" ")

output(limit)

However the answer shows up as 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5. I know it’s because of the end=" " but not sure how to get around it! Any help appreciated