Printing multiple objects without spaces
<p>I'm writing a basic program to convert any 4 digit number in reverse.</p>

<p>I know I'm taking a very complex approach, but that's what my professor requires. So far I've got:</p>

<pre><code>print("This program will display any 4-digit integer in reverse order")

userNum = eval(input("Enter any 4-digit integer: "))

num1 = userNum % 10

userNum2 = userNum // 10

num2 = userNum2 % 10

userNum3 = userNum // 100

num3 = userNum3 % 10

userNum4 = userNum // 1000

num4 = userNum4 % 10

print(num1,num2,num3,num4)
</code></pre>

<p>The issue I'm having is the output from the print statement gives me</p>

<pre><code>x x x x
</code></pre>

<p>When I would prefer to have</p>

<pre><code>xxxx
</code></pre>

<p>Any advice?</p>

<p>Since you just want to convert the input in reverse order. You can take the following approach.</p>

<pre><code>print("This program will display any 4-digit integer in reverse order")
userNum = input("Enter any 4-digit integer: ")
reverse_input = userNum[::-1]
reverse_input = int(reverse_input) # If you want to keep input as an int class
print(reverse_input)
</code></pre>

<p>If you want to use your own code then just change the print statement.</p>

<pre><code>print(str(num1) + str(num2) + str(num3) + str(num4))
</code></pre>

<p>String concatenation does not add space so you should get desired result.</p>

python printing reverse spaces