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
Here is the header for a function named computeValue:
zhuklara [117]

Answer:

B) computeValue(10);

Explanation:

Given

Header: void computeValue(int value)

Required

Determine the valid call

To call a function from another function or from the main, the following syntax has to be used.

<em>function-name(parameter-1, parameter-2, parameter-3,.....,parameter-n);</em>

<em />

In the function header given:, the following can be observed:

  • The function name is computeValue
  • It has only one parameter and it is of type integer

So, to call the function; we make use of computeValue(10);

Where 10 represents the value of the parameter (i.e. argument)

7 0
2 years ago
Multiple Intelligence Theory explains that...
Alex

Answer:

A. We all learn differently (edge 2020)

Explanation:

4 0
3 years ago
Read 2 more answers
Which of these is an advantage of having multiple layers in a drawing and enables you to make changes to one part of an image wi
Ivan

Answer:

enables you to make changes to one part of an image without accidentally changing other parts

Explanation:

Computer aided designs incorporate the use of multiple layers in drawings. The first layer is known as the layer 0, while the present layer the designer is working on is known as the current layer. The advantage of the incorporation of layers in designs include the following

1. It helps objects to be altered, grouped, hidden and moved as the designer wishes.

2. Layers can be grouped and worked on separated and common properties like color and line weight assigned to them.

3. Layers can be manipulated as the user wishes. They can be locked, frozen, turned off, etc.  Locking prevents accidental changes being made on objects.

4 0
2 years ago
You are troubleshooting a computer that is in the design phase. The problem you see is that the CPU is not receiving information
iogann1982 [59]

Answer:

Control bus

Explanation:

A control bus is a PC bus that is utilized by the CPU to speak with gadgets that are contained inside the PC. This happens through physical associations, for example, links or printed circuits.

The CPU transmits an assortment of control sign to parts and gadgets to transmit control sign to the CPU utilizing the control bus. One of the principle targets of a transport is to limit the lines that are required for communication

An individual bus licenses communication between gadgets utilizing one information channel. The control transport is bidirectional and helps the CPU in synchronizing control sign to inside gadgets and outer segments. It is included interfere with lines, byte empower lines, read/compose sign and status lines.

8 0
3 years ago
How would you use SQL to change a table's structure? What general types of changes are possible? Which commands are used to impl
xz_007 [3.2K]

The SQL is used to change a table's structure by:

The use of the SQL ALTER TABLE command.

<h3>How is it done?</h3>

The SQL ALTER TABLE command is known to  be that which is often used to alter the structure of an existing table.

It is known to help one to be able to add or delete columns, make or destroy indexes, alter the kinds of existing columns, rename columns or the table itself.

Note that  It can also be used to alter the comment for any kind of table and type of the table therein.

Learn more about SQL from

brainly.com/question/25694408

#SPJ1

4 0
2 years ago
Other questions:
  • Given a int variable named yesCount and another int variable named noCount and a char variable named response, write the necessa
    9·1 answer
  • Your health insurance company gives you a discount if you wear a fitness-tracking bracelet. After wearing it for a few months, y
    5·1 answer
  • If you are unsure about what is or isn’t appropriate to wear to a new job, what is the best thing to do?
    13·2 answers
  • Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (
    12·1 answer
  • Apex
    5·2 answers
  • An IT suspects that an unauthorized device is connected to a wireless network. This is a result of passkey sharing on a device b
    14·1 answer
  • Jon wants to assign a value to the favorite food variable: favoriteFood! = "Pizza" but gets an error message. What does he need
    9·2 answers
  • The software concept ___________and defines a need for the new system.
    6·1 answer
  • What is the core function of an enterprise platform
    12·2 answers
  • Your customer said that understanding the directions is difficult. This is an aspect of
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!