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
Task queues, which allow for asynchronous performance, are an important part of modern processing architectures. Information abo
Vilka [71]

This subject is a sub-topic in Computer Science and is related to how computers process tasks using Modern Processing Architectures. Modern Processor Architecture is an offshoot of computer architecture.

<h3>What is Modern Processing  Architecture?</h3>

Please note that the information is incomplete hence the general answer. The complete question should provide figures for items 1 to 3.

Modern Processor Architecture is the name given to computer processors with highly advanced capabilities.

In simple language, processors with modern architectures are those that have been built with the ability to complete many instructions or tasks at the same time.

It can also perform or execute these instructions in random order. When a processor is able to do this, it is called Asynchronous performance.

Learn more about Computer Architecture at:

brainly.com/question/18185805

4 0
2 years ago
After sending input in the Chinese language to an AI system, Nina got numerous translations in the English language. Which chall
ad-work [718]

Answer:

i think its translation complexity

Explanation:

8 0
3 years ago
What are the advantages of wired networks?
lesya [120]

Answer:

1   2    4

Explanation:

6 0
3 years ago
What is IBM compadibles
mixer [17]

Answer:

IBM PC compatible computers are computers similar to the original IBM PC, XT, and AT that are able to use the same software and expansion cards. Such computers were referred to as PC clones, or IBM clones

8 0
3 years ago
Ok. So i am so confused. I have a message in my inbox but when I try to go to my inbox there is nothing there. Is that normal fo
GrogVix [38]

Answer:

yeah

Explanation:

that happens to me as well from time to time

7 0
3 years ago
Other questions:
  • 10. Which of these is not an HTTP verb? PUT AJAX GET DELETE
    12·1 answer
  • ________ is an open-source program supported by the Apache Foundation that manages thousands of computers and implements MapRedu
    5·1 answer
  • 1.Characters archetypes are typical characters that represent universal patterns of human or human roles. (True or false)
    14·1 answer
  • A pointing device controls the movement of the ____.
    15·1 answer
  • Given the code that reads a list of integers, complete the number_guess() function, which should choose a random number between
    6·1 answer
  • You use an escape sequence to include ___________________ in a string.
    15·1 answer
  • you turn on your desktop computer. You can hear the fans start up, but the monitor remains blank. You wait a while, but it doesn
    14·1 answer
  • Once secured a wheelchair may move up to 6 inches in any direction
    6·1 answer
  • Mr. O would like to purchase a new computer for his home business. Mr. O's current computer runs very slow when he is running e-
    5·2 answers
  • Lol fortnite really going UwU and anime
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!