• Source
    1. input_text = "Hello World!"
    2. output_text = ""
    3.  
    4. for character in input_text:
    5.  
    6. if character.isalpha():
    7.  
    8. rotated_ordinal = ord(character) + 13
    9.  
    10. if (character.isupper() and character > 'M') or (character.islower() and character > 'm'):
    11. rotated_ordinal -= 26
    12.  
    13. output_text += chr(rotated_ordinal)
    14.  
    15. else:
    16.  
    17. output_text += character
    18.  
    19. print(output_text)
    20.