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
natta225 [31]
3 years ago
8

Write the function lettersOnly(s) that takes in a string called s, and returns a string containing only the alphabetic character

s of s.
Computers and Technology
1 answer:
Phantasy [73]3 years ago
4 0

Answer:

The program to this question as follows:

Program:

def lettersOnly(s): #defining method lettersOnly

   val="" #defining string variable that return value

   for i in s: #defining loop to calculate value

       if(i.isalpha()): #check condition that value is string

           val=val+ i #add value

   return val #return value

print(lettersOnly("data3base_ro1c3k5s")) #call method and print value

Output:

databaserocks

Explanation:

In the above python code, a method lettersOnly is declared that accepts a string variable  "s" in its parameter. Inside the method, a string variable "val", and loop is declared, in which the "val" variable holds method return value.

  • In the loop and if block is used that uses "isalpha" string method, which checks the check alphabetic character in the given value. if this is true it will calculate all value in "val" variable and return its value.    
  • At the last, the print method is used, which calls the lettersOnly method and prints its return value.
You might be interested in
Write the output of the following program:
Iteru [2.4K]

Answer:

Expression A

Explanation:

In this Pseudocode, the output would be 100. This is because the code is looping from 1 to 20 and adding together all of the odd numbers between 1 and 20. Since it is checking to make sure that the remainder of each number is not equal to 0 which would indicate an odd number, and if it is odd then it adds it to the variable S. Therefore, the odd numbers between 1 and 20 are the following...

1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 + 19 = 100

6 0
3 years ago
What is folded card publishing?​
Alexeev081 [22]

Answer:

Folded card This layout type is for creating greeting cards by printing pages on a sheet and then folding the sheet to make the card. If you choose the Folded card layout, then sheet fold options are displayed. Select an option in the list to specify how you will fold your publication

Explanation:

3 0
2 years ago
Read 2 more answers
Connect research concepts to their definitions
stellarik [79]
Answer Research is defined as the creation of new knowledge and/or the use of existing knowledge in a new and creative way so as to generate new concepts, methodologies and understandings
8 0
2 years ago
The ____ allows 127 different devices to connect to a computer via a single usb port on the computer’s system unit
hram777 [196]
<span>I'm 100% sure that correct answer should look like this: The USB standart port allows 127 different devices to connect to a computer via a single usb port on the computer’s system unit.</span>
4 0
3 years ago
Jeremy is the team leader of the employees planning to display the company’s new product at a big convention. He needs to be sur
Luden [163]
Assuming no options are provided, Jeremy would do well to create a weekly progress report, detailing what the company has accomplished during the week, and what remains to be accomplished. The report should be goal-based with defined deadlines, and clear explanations on what has been done and what remains to be done, and should be organized by the various aspects of the project (accounting, marketing, etc). This report will help keep his team conscience of their role within the larger project, what they have accomplished thus far, and what still needs to be done.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Which of these should most likely be included in a wire frame ?
    12·1 answer
  • If you are feeling sick and you want to drive somewhere, you should
    12·2 answers
  • Computers store temporary Internet files in the Recycle Bin. These files take up space and slow down a computer. Which tool can
    10·1 answer
  • What are personal skills?
    5·1 answer
  • What is not true of credit scores?
    11·1 answer
  • 5. The operating system has two components
    12·2 answers
  • Which tools is used to bundle cables neatly inside and outside of a computer?​
    15·1 answer
  • Why do guys get jealous when u hangout with another guy that's not them
    6·2 answers
  • Can you distinguish between the following examples and determine which one is NOT creative work? a. software b. slogan c. screen
    15·1 answer
  • Suggest 4 new features for microsoft word/excel.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!