Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- choice = input("Would you like to encode or decode?")
- shiftValue = 4
- def Encoder():
- secretMsg = input("What message would you like to encode?")
- for char in secretMsg:
- x = ord(char)
- x += shiftValue
- x = chr(x)
- print(x, end="")
- def Decoder():
- secretMsg = input("What message would you like to decode?")
- for char in secretMsg:
- x = ord(char)
- x -= shiftValue
- x = chr(x)
- print(x, end="")
- def Choose(choice):
- if (choice == "Encode" or "encode"):
- Encoder()
- elif(choice == "Decode" or "decode"):
- Decoder()
- else:
- print("Error: Please input either encode or decode.")
- Choose(choice)
Add Comment
Please, Sign In to add comment