Q:

How to draw numbers from a new line?

there is a code with prime numbers (which are displayed in the desired range)

Make simple numbers appear on the new line.

Here is the code:
a, b = map(int, input().split())
ls = []
for i in range(a, b + 1):
 if all(i % n != 0 for n in range(2, i)):
   ls.append(str(i))
 if len(ls):
   print(' '.join(ls))
 else:
   print(0)

A:

I think you need a loop for print the result 
print('= Enter the range (a,b) =')
a, b = map(int, input().split())
ls = []
for i in range(a, b + 1):
 if all(i % n != 0 for n in range(2, i)): # check the numbers
   ls.append(str(i))

print('========= Result ========')
#print the result
for number in ls:
    print(number)

print('========== End ==========')

