You will use Python's ord and chr to work with ASCII codes, and work out the space a message needs.
Your tasks.
codes to the list of ASCII codes of the letters of word, in order. Use ord.to_small, return the small letter for a capital letter. Use the rule that a small letter is 32 more than its capital.bits_needed, return the number of bits a text needs with per_char bits for each character.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…