subject

Implement the following functions

def normalize(input_string):

input: a string of text characters. Each character is called a token.

output: an array of 'letters'. Each item in the array corresponds to a letter in input_string (in lowercase)

for example, the input "O. K. #1 Python!" would generate the following list: ['o','k','p','y','t','h','o','n']
look at the documentation for string functions; don't try to replace, delete, or substitute -- if the 'token' is a letter it passes the test.

def find_missing_letters(sentence):

the input sentence is an array/list (created from normalize())

returns a sorted array of letters that are NOT in the sentence

use the built in Python type set to solve (see previous lesson)

def find_missing_letters_algorithm(sent ence):

the input sentence is an array/list (created from normalize())

returns a sorted array of letters that are NOT in the sentence

you must NOT use the set type

implement the function pipeline(), which pipes the output of each step in the pipeline process into the next stage. For example, if you had the functions a1, b2, c3, pipeline would just do something like return c3(b2(a1())).

The answer should read (inside out) and be a single line of code.

You can use either find_missing_letters_algorithm or find_missing_letters since both return the same output.

Your final stage should be calling visualize (already done)

starter code

import lesson

def test_missing_letters():
sentence = lesson. normalize("I am missing many letters")
s = lesson. find_missing_letters(sentence)
print(s)

# First test your implementation
test_missing_letters()

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:10
Which is a benefit of peer-to-peer networking? easy to add or remove devices main server has a fast processor more reliable than a client/server network same software versions on all computers
Answers: 3
question
Computers and Technology, 22.06.2019 15:10
Consider a direct-mapped cache with 216 words in main memory. the cache has 16 blocks of 8 words each. it is a word-addressable computer (rather than a byte-addressable computer which we normally discuss). (a) how many blocks of main memory are there? (b) what is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, cache block, and block offset fields (if they apply)? (c) to which cache block will the memory reference db6316 map?
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
How to do this programming flowchart?
Answers: 3
You know the right answer?
Implement the following functions

def normalize(input_string):

input: a stri...
Questions
question
English, 16.07.2019 07:50
Questions on the website: 13722363