function for calculating the encryption
def cipher ( str ) : NEW_LINE INDENT for i in range ( len ( str ) ) : NEW_LINE INDENT if str [ i ] . isalpha ( ) == 0 and str [ i ] != " ▁ " : NEW_LINE INDENT print ( " Enter ▁ only ▁ alphabets ▁ and ▁ space " ) NEW_LINE return NEW_LINE DEDENT DEDENT print ( " Encrypted ▁ Code ▁ using ▁ Latin ▁ Alphabet " ) NEW_LINE for i in range ( len ( str ) ) : NEW_LINE INDENT if str [ i ] >= " A " and str [ i ] <= " Z " : NEW_LINE INDENT print ( ord ( str [ i ] ) - ord ( " A " ) + 1 , end = " ▁ " ) NEW_LINE DEDENT elif str [ i ] >= " a " and str [ i ] <= ' z ' : NEW_LINE INDENT print ( ord ( str [ i ] ) - ord ( " a " ) + 1 , end = " ▁ " ) NEW_LINE DEDENT if str [ i ] == " ▁ " : NEW_LINE INDENT print ( str [ i ] ) NEW_LINE DEDENT DEDENT print ( ) NEW_LINE DEDENT