Last active
February 1, 2019 06:21
-
-
Save lettergram/4bd6f589a2eb04ed3da0ad47008ed1e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python Implementation of Hello Worms | |
string = bytearray("Hello, Worms!", 'UTF-8') | |
for i in range(int(len(string) / 2)): # Cast to int for Range | |
temp = string[i] | |
string[i] = string[len(string) - i - 1] # -1 or error | |
string[len(string) - i - 1] = temp # add -1 or error | |
print(string.decode('UTF-8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment