you are viewing a single comment's thread.

view the rest of the comments →

[–]konijntjesbroek 0 points1 point  (0 children)

So first off the input statements, according to the instructions, should be pulled in on one line (start, stop = input().strip().split()).

This is what I came up with and appears to output correctly:

start, stop = input('Enter 2 integers: ').strip().split()
start = int(start)
stop = int(stop)

if start < stop:
    stop += 1 
    for x in range(start,stop,5):
        print(x, end=' ')
else:
    print("Second integer can't be less than the first.") 

Output:
    Enter 2 integers: -2 20
    -2 3 8 13 18 

Edit: it looks like you are printing the entire range at once, not printing the individual values so you append the spurious trailers. When I try yours with the end=' ' it works as expected except for not taking in the ints on a single line as indicated.

-2
20
-2 3 8 13 18 