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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, olorteguimikie
Which part of the cpu accepts data?
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, keyonaemanieevans
Helen is having a meeting with her colleagues in her company. they are working on the goals and objectives for the coming year. they want to ensure that these goals and objectives of the processes involved are properly evaluated. which system can helen and her colleagues apply to evaluate this? helen and her colleagues require a blank to evaluate the goals and objectives.
Answers: 2
image
Computers and Technology, 24.06.2019 07:00, AnaiyaKirksey8
You are most likely to automatically encode information about
Answers: 1
image
Computers and Technology, 24.06.2019 10:20, silviamgarcia
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
You know the right answer?
Implement the following functions

def normalize(input_string):

input: a stri...

Questions in other subjects:

Konu
Mathematics, 22.07.2019 02:30