1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Cerrena [4.2K]
3 years ago
13

Implement the following functions def normalize(input_string): input: a string of text characters. Each character is called a to

ken. 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'] take a look at the Python documentation for string functions (url given below); don't try to replace, delete, or substitute -- if the 'token' is a letter it passes the test.
Computers and Technology
1 answer:
Crank3 years ago
6 0

Answer:

  1. def normalize(input_string):
  2.    output = []
  3.    for c in input_string:
  4.        if(c.isalpha()):
  5.            output.append(c.lower())
  6.    
  7.    return output
  8.    
  9. print(normalize("O.K. #1 Python!"))

Explanation:

Firstly, create a function normalize that takes one input string (Line 1).

Next, we create an empty list and assign it to output variable (Line 2). This list will hold all the letters from the input string.

Create a for loop to traverse each of the character in the input string (Line 4) and then use isalpha() method to check if the current character is a letter (Line 5). If so, add the letter to output list (Line 6). Please note we can convert the letter to lowercase using lower() method.

After completing the loop, return the output list (Line 8).

We can test the function using the sample input given in the question (Line 10) and we shall get ['o', 'k', 'p', 'y', 't', 'h', 'o', 'n']

You might be interested in
1. Se requiere implementar un conversor unipolar que tendrá una tensión analógica variable entre 0 y 2 V pico. Deberá tener una
PolarNik [594]

Answer:

A

Explanation:

Because

7 0
3 years ago
Is it more beneficial to have many folders or is it better to " nest subfolders? Explain your response
riadik2000 [5.3K]
I think it's better to have multiple folders because for say you have 6 school subjects but only have 1 folder how are you going to keep track with all 6 subjects in one folder ? You could use each folder for each subject which would save you a lot of time when it comes to getting out your complete work .You can have one folder such as "Workspace" and have multiple different sub-folders that relate that to "Workspace". Also if you store pictures in a folder, it might be a good idea to separate them into different sub-folders.
3 0
3 years ago
. Each ____ on a menu performs a specific action.
Fofino [41]
The answer would be d, none kf the above.
4 0
3 years ago
What is the type of person of personal computer which is also called a laptop computer?
gulaghasi [49]

Today personal computer is changed to laptop mode. Personal computer is made of CPU, monitor, keyboard, printer and mouse. All input device and output device connected with wire or without wire.

<u>Explanation:</u>

Personal computers are also called as desktop or workstation. These days all become compatible device which is called as laptop.

Basically all input devices and output device are fixed in laptop so end user can carry the laptop and used anywhere.

Laptop is charged and used, whereas desktop or workstation just fixed in the table and used it.

7 0
3 years ago
How i can download play store?​
Phantasy [73]

Answer:

in Google type play Store and you will get the app and then click on that word install and it will get installed

Explanation:

hope this helps

3 0
3 years ago
Other questions:
  • Assign to avg_owls the average owls per zoo. Print avg_owls as an integer. Sample output for inputs: 1 2 4 3
    7·1 answer
  • Computer communications describes a process in which two or more computers or devices transfer ____.
    10·1 answer
  • Create a class 'ProblemSolution' with following characteristics A public method 'solution' without parameters and return type is
    14·1 answer
  • In the URL, what is the subdomain and what is the domain name?
    5·1 answer
  • Identify a characteristic of electronic meeting systems.
    10·1 answer
  • Is orange named after the fruit or of the color?
    9·1 answer
  • Implement the Tollable interface. It provides one method, pay, that accepts an int (how many dollars to pay), and returns an int
    8·1 answer
  • Im learning about AI in my class and I'm confused about these two questions
    9·2 answers
  • Suppose a packet is 10K bits long, the channel transmission rate connecting a sender and receiver is 10 Mbps, and the round-trip
    10·1 answer
  • What represents a user’s specific preferences?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!