


"""simple docstring"""



import math







def   __lowerCAmelCase						(						)	->						None:


    """simple docstring"""





    snake_case    :      Any      					=    input("Enter message: " )
    snake_case    :      str      					=    int(input(F'Enter key [2-{len(lowercase ) - 1}]: ' ) )
    snake_case    :      Optional[Any]      					=    input("Encryption/Decryption [e/d]: " )

    if mode.lower().startswith("e" ):
        snake_case    :      List[str]      					=    encrypt_message(lowercase						,							lowercase )
    elif mode.lower().startswith("d" ):
        snake_case    :      int      					=    decrypt_message(lowercase						,							lowercase )

    # Append pipe symbol (vertical bar) to identify spaces at the end.
    print(F'Output:\n{text + "|"}' )







def   __lowerCAmelCase						(						lowercase  :  int						,							lowercase  :  str )	->						str:


    """simple docstring"""





    snake_case    :      Union[str, Any]      					=    [""] * key
    for col in range(lowercase ):
        snake_case    :      List[Any]      					=    col
        while pointer < len(lowercase ):
            cipher_text[col] += message[pointer]
            pointer += key
    return "".join(lowercase )







def   __lowerCAmelCase						(						lowercase  :  int						,							lowercase  :  str )	->						str:


    """simple docstring"""





    snake_case    :      Union[str, Any]      					=    math.ceil(len(lowercase ) / key )
    snake_case    :      List[str]      					=    key
    snake_case    :      Optional[int]      					=    (num_cols * num_rows) - len(lowercase )
    snake_case    :      Any      					=    [""] * num_cols
    snake_case    :      Tuple      					=    0
    snake_case    :      Union[str, Any]      					=    0

    for symbol in message:
        plain_text[col] += symbol
        col += 1

        if (
            (col == num_cols)
            or (col == num_cols - 1)
            and (row >= num_rows - num_shaded_boxes)
        ):
            snake_case    :      int      					=    0
            row += 1

    return "".join(lowercase )


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()









"""simple docstring"""



def   __lowerCAmelCase						(						lowercase  :  list[int] )	->						float:


    """simple docstring"""





    if not nums:  # Makes sure that the list is not empty
        raise ValueError("List is empty" )

    snake_case    :      List[str]      					=    sum(lowercase ) / len(lowercase )  # Calculate the average
    return sum(abs(x - average ) for x in nums ) / len(lowercase )


if __name__ == "__main__":
  import doctest

  doctest.testmod()





