Monday, 8 June 2020

48 Decryption: Caesar

#Caesar code DECRYPT -1

#L1 = ['a','e'] # + swap 'find' for 'index'
L1 = 'aeiou'
print (' introdu')
MESS = input ()

for LETTER in MESS:
    NEWPOS = L1.find(LETTER)-1 # Decrypt +1 ---> -1
    if NEWPOS == -2 :
        print ('\nthe letter ' + LETTER+ ' is not included')
        break
    elif NEWPOS <0:  # >= len (L1) -----> < 0
        NEWPOS = len(L1) -1 # 0 ----> len(L1) -1       
    print (L1[NEWPOS], end = '')