Jerald is an archaeologist and is trying to decifer a ceaser shift. Create some code to help him out
def decrypt(code,amount):
#place code here
let="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
word = ""
x=0
for c in range(0,len(code)):
for i in range (0,len(let)):
if code[c] == " ":
word+=" "
break
elif code[c] == let[i]:
x=i
x-=amount
if x < 0:
x+=26
word+=let[x]
break
return word
Test.assert_equals(decrypt("MJQQT YMJWJ",5),"HELLO THERE")
Test.assert_equals(decrypt("FVB NVA TL",7),"YOU GOT ME")