Caesar Cipher Code Python printing on separate lines
<p>The code below works fine, however the message prints onto separate lines once it has been encrypted. For example if I type: abc with the shift of 1 it encrypts it but prints it back as:</p>

<pre><code>b
c
d
</code></pre>

<p>And I don't understand why. I want it to print as:</p>

<pre><code> bcd 
</code></pre>

<p>Here is the code:</p>

<pre><code>print("Welcome to the Code-Breaking/Making Software")
print("This program uses something called a Caesar Cipher.")

Message = (input("Please enter the message you wish to Encrypt &gt;&gt; "))
Shift = int(input("Please enter the shift for your message &gt;&gt; "))

for x in Message:
    OrdMessage = ord(x) 
    ShiftedMessage = OrdMessage + Shift
    NewMessage = chr(ShiftedMessage)
    NewMessageList = list(NewMessage)
    print("".join(NewMessageList))
</code></pre>

<p>Indentation matters and you shouldn't create new list of <code>NewMessage</code> everytime  </p>

<pre><code>print("Welcome to the Code-Breaking/Making Software")
print("This program uses something called a Caesar Cipher.")

Message = (input("Please enter the message you wish to Encrypt &gt;&gt; "))
Shift = int(input("Please enter the shift for your message &gt;&gt; "))

NewMessageList = []
for x in Message:
    OrdMessage = ord(x) 
    ShiftedMessage = OrdMessage + Shift
    NewMessage = chr(ShiftedMessage)
    NewMessageList.append(NewMessage)
print("".join(NewMessageList))
</code></pre>

python encryption caesar-cipher