Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Word to Bitstring to Boolean List Create a function that converts a word to a bitstring and then to a boolean list based on the
Word to Bitstring to Boolean List Create a function that converts a word to a bitstring and then to a boolean list based on the following criteria: 1. Locate the position of the letter in the English alphabet (from 1 to 26). 2. Odd positions will be represented as 1 and even positions will be represented as o 3. Convert the represented positions to boolean values, 1 for True and o for False. 4. Store the conversions into an array. Examples to boolean list ("dep") + [False, True, True, False] # deep converts to 0110 # d is the 4th alphabet - 0 # e is the 5th alphabet - 1 #e is the 5th alphabet - 1 # p is the 16th alphabet - 0 to_boolean_list("loves") + [False, True, False, True, True] to boolean list ("tesh") [False, True, True, False] Notes The letter A is at position 1 and 2 at 26. All input strings are in lowercase letters of the English alphabet
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started