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
A presentation has bullet points that move. The presenter wants to use these bullet points in several other places in the presen
goldenfox [79]

Answer: Animation Painter.

In Microsoft Powerpoint, the most common method would be to simply animate each bullet point in the entire presentation. The Animation Painter is a tool that has been included to copy all the animations of a single object and apply them to another object selected.

How to use:

  1. Select the object with the animations already applied to.
  2. Click on the Animation Painter.
  3. Select the object that you would like to apply the animations to.
  4. Done.
6 0
3 years ago
When did economies begin?
Pavlova-9 [17]
They began in ancient times the babylons started trading
6 0
3 years ago
Read 2 more answers
Which of these agents of education empowers the other..........
Tomtit [17]

Answer:

B. school

Explanation:

Because the school is where you learn and gain knowledge

4 0
2 years ago
Read 2 more answers
Game development is a time-consuming and expensive endeavor, and being a Lone Ranger is a recipe for disaster
belka [17]
False although depends on the future of the person's ideas
7 0
3 years ago
Computers can be positioned on a network in different ways relative to each other. true false
Likurg_2 [28]
False they cant do that
4 0
3 years ago
Other questions:
  • Write a program to read as many test scores as the user wants from the keyboard (assuming at most 50 scores). Print the scores i
    13·1 answer
  • What color does Sam obtain when he mixes white with a color? Sam is painting a landscape and needs to paint the sky light blue.
    9·2 answers
  • What are the two types of digital water marking?
    5·1 answer
  • What happens when two computers use the same IP address?
    15·1 answer
  • Write a C program to calculate and display the coordinates of midpoint - M of a linesegment between two given points - say A and
    7·1 answer
  • What is a spreadsheet program?<br> A spreadsheet program is a computerized version of _______
    5·1 answer
  • Gun to yo head any last words??
    10·2 answers
  • What are the words that make up a high-level programming language called?
    6·1 answer
  • What is the difference between electrical and electronic devices?
    5·2 answers
  • PLS HELP SOON
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!