I'm attempting to create a one line Caesar cipher decryption program in python and i'm afraid i've come to the end of my knowledge and well past it.
this is the closest working code i've got:
def test3():
print("The decrypted text is: "+"".join(map(lambda x: chr(ord(x)+y),x)))
as you can see it requires me to define x and y (the input text and the shift amount respectively) before hand. this wont do, next i tried this (and several variations of)
def test4():
print("The decrypted text is: "+"".join(map(lambda x=input("text: "),y=eval(input("shift: ")): chr(ord(x)+y),x)))
but x is undefined globally
the function should run as follows:
>>>text: |nqq
>>>shift: -5
The decrypted text is: will
any help would be greatly appreciated
ps. using python 3.1.3