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
Which of the following is NOT a long-term storage device?
neonofarm [45]

The storage device which is not a long-term storage device is: D. RAM.

<h3>Types of computer memory.</h3>

In Computer technology, there are two (2) main types of memory or storage location for software program (application) that are being used on a computer and these include the following;

  1. Read only memory (ROM)
  2. Random access memory (RAM)

<h3>What is RAM?</h3>

RAM is an abbreviation for random access memory and it can be defined as a volatile and temporary storage (memory) location that is used for currently opened software program (application) and computer data.

In conclusion, we can reasonably and logically deduce that the storage device which is not a long-term storage device is random access memory (RAM).

Read more on RAM here: brainly.com/question/13748829

#SPJ1

3 0
1 year ago
Ten output devices you know
jasenka [17]
Monitor
Printer
Headphones
Computer Speakers
Projector
GPS
Sound Card
Video Card
Braille Reader
Speech-Generating Device

6 0
3 years ago
How do you find the exterior angle measure of any regular polygon? (The degree in which to turn the turtle to draw a shape)
Diano4ka-milaya [45]

Answer:

360/number of sides

Explanation:

all the exterior angles add up to 360°

so to find each angle mesure, divide the 360 by the number of sides the figure has.

7 0
3 years ago
IF YOU GET 5/5 RIGHT YOU WILL GET BRAINLIEST AND 50 [POINTS
natta225 [31]

Answer:

The sort function

Explanation:

Because it will sort all the numbers.

4 0
2 years ago
Read 2 more answers
List 5 ways by which Artificial intelligence (AI) can be used to drive our business.​
andreyandreev [35.5K]

Answer:

start a website

Explanation:

true

5 0
3 years ago
Other questions:
  • When there are items that are out of the control of the programmer that may support or oppose the program goals, this is termed
    15·1 answer
  • The concept of vertical farming allows agriculture to occur when there is not enough___Available .
    13·1 answer
  • Which of the following statements best deceive the relationship between carrying capacity and population size
    12·1 answer
  • Help!!!! ASAP TIMED TEST 50 points!!!!
    7·1 answer
  • What characters cannot be used in a filename?
    15·1 answer
  • What is the purpose of a mutator?
    8·1 answer
  • (TCO B) The symbol shown as a three-sided box that is connected to the step it references by a dashed line is what?
    12·1 answer
  • Karin realized that a song takes up a lot more space on her computer than the lyrics of the song typed out in ms word document .
    12·1 answer
  • Answer for 5,6,7 any one know plz
    8·1 answer
  • Released in 1976, the Apple I was Apple Computer's first product.<br><br> O True<br> O False
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!