Skip to content

Instantly share code, notes, and snippets.

@codeboy101
Created June 6, 2017 17:58
Show Gist options
  • Save codeboy101/5bbecafb7c00a283ec9ef863a12ff4ef to your computer and use it in GitHub Desktop.
Save codeboy101/5bbecafb7c00a283ec9ef863a12ff4ef to your computer and use it in GitHub Desktop.
from string import ascii_lowercase
code = {
'a':'b', 'b':'c', 'c':'d', 'd':'e', 'e':'f', 'f':'g', 'g': 'h', 'h': 'i', 'i': 'j', 'j': 'k', 'k' : 'l', 'l' : 'm',
'm' :'n', 'n' :'o', 'o': 'p', 'p':'q', 'q' : 'r', 'r': 's', 's': 't', 't' : 'u', 'u':'v', 'v': 'w', 'w':'x',
'x' : 'y', 'y' : 'z', 'z' : 'a', ' ': ' '
}
allowedchars = ascii_lowercase + ' '
def changer(a,b):
code[a] = b
return code
def message():
put = input("Enter Text ")
put = put.lower()
for i in put:
if i in allowedchars:
print(code[i], end='')
elif put == '!!!':
return
else:
raise Exception("404")
print()
def changemsg():
fromletter = input ("Enter Base Letter ")
toletter = input ("Enter to Change")
code = changer(fromletter, toletter)
def show_code():
for k, v in code.items():
print(k, v)
if __name__ == '__main__':
run = True
while run:
gamestart = input("What to do, press 1 to 2")
if gamestart == '1':
taker()
elif gamestart == '2':
changing()
else:
run = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment