ciphers.baconian_cipher ======================= .. py:module:: ciphers.baconian_cipher .. autoapi-nested-parse:: Program to encode and decode Baconian or Bacon's Cipher Wikipedia reference : https://en.wikipedia.org/wiki/Bacon%27s_cipher Attributes ---------- .. autoapisummary:: ciphers.baconian_cipher.decode_dict ciphers.baconian_cipher.encode_dict Functions --------- .. autoapisummary:: ciphers.baconian_cipher.decode ciphers.baconian_cipher.encode Module Contents --------------- .. py:function:: decode(coded: str) -> str Decodes from Baconian cipher >>> decode("AABBBAABAAABABAABABAABBAB BABAAABBABBAAAAABABAAAABB") 'hello world' >>> decode("AABBBAABAAABABAABABAABBAB") 'hello' >>> decode("AABBBAABAAABABAABABAABBAB BABAAABBABBAAAAABABAAAABB!") Traceback (most recent call last): ... Exception: decode() accepts only 'A', 'B' and spaces .. py:function:: encode(word: str) -> str Encodes to Baconian cipher >>> encode("hello") 'AABBBAABAAABABAABABAABBAB' >>> encode("hello world") 'AABBBAABAAABABAABABAABBAB BABAAABBABBAAAAABABAAAABB' >>> encode("hello world!") Traceback (most recent call last): ... Exception: encode() accepts only letters of the alphabet and spaces .. py:data:: decode_dict .. py:data:: encode_dict