a = input().split()
for i in a:
c = int(i)
if c > 0:
b = c - 4
d = b % 10
if d != 0:
print(i, "", end='')
else:
e = c + 4
f = e % 10
if f != 0:
print(i, "", end='')
This the whole code
The expected final output should be integers with space in between but no space at the end
By adding ""
I got spaces in between the elements.
So, how do I delete the space after the final, last element.