You're printing the elements and not returning anything. Either don't print the output of the function, or use a generator function if you want to do something like this.
Not Printing the Output of the Function:
lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
def allElementsSingleRow(lst):
for i in lst:
print(i, end= " ")
allElementsSingleRow(lst)
Using a generator
lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
def allElementsSingleRow(lst):
for i in lst:
yield i
for element in allElementsSingleRow(lst):
print(element, end=" ")