Hi experts, need your help with Python. Code guide is given at the picture and sample input and output. THE RESULTING BINARY STRING SHOULD HAVE AN 8 CHARACTERS. Using char_to_ascii(), write a program that converts each character in the given string word into its integer counterpart (ASCII decimal value) and returns them in the list ascii_values. Using ascii_to_binary(), write a program that will convert the given list, ascii_values, into strings containing their binary values and return the converted values in the list binary_values. e.g. the list [4, 3, 1] will be returned as [‘100’, ‘11’, ‘1’]] Input Format The user will enter the sentence in one line. Example: t#3qu1cKbR0wNfoX7uMp3D...!!! Constraints The given word will only contain characters from the ASCII table with values between 32 and 126. len(word) Output Format The program will print one line for each character from the user input with the following format: :-

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter2: Problem Solving Using C++using
Section2.3: Data Types
Problem 9E: (Practice) Although the total number of bytes varies from computer to computer, memory sizes of...
icon
Related questions
Question

Hi experts, need your help with Python. Code guide is given at the picture and sample input and output. 

THE RESULTING BINARY STRING SHOULD HAVE AN 8 CHARACTERS.

Using char_to_ascii(), write a program that converts each character in the given string word into its integer counterpart (ASCII decimal value) and returns them in the list ascii_values.

Using ascii_to_binary(), write a program that will convert the given list, ascii_values, into strings containing their binary values and return the converted values in the list binary_values. e.g. the list [4, 3, 1] will be returned as [‘100’, ‘11’, ‘1’]]

Input Format

The user will enter the sentence in one line.

Example:

t#3qu1cKbR0wNfoX7uMp3D...!!!

Constraints

The given word will only contain characters from the ASCII table with values between 32 and 126. len(word)

Output Format

The program will print one line for each character from the user input with the following format:

<character>:<asciidecimalvalue>-<asciibinaryvalue>
[75, 98, 105, 111,
108, 124, 90, 108,
111, 111, 97]
['01001011', '01100010', '01101001’, '01101111’, '01101100', '01111100',
*01011010', '01101100', '01101111’, '01101111’, '01100001']
'Kbiol|Zlooa'
Transcribed Image Text:[75, 98, 105, 111, 108, 124, 90, 108, 111, 111, 97] ['01001011', '01100010', '01101001’, '01101111’, '01101100', '01111100', *01011010', '01101100', '01101111’, '01101111’, '01100001'] 'Kbiol|Zlooa'
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
ASCII Codes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr