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 the most significant outcome of the formation of the SMPTE?
olga55 [171]

Answer:

The SMPTE created an organized system of film technology, development, and distribution.

Explanation:

The SMPTE opened the door for Union organization within the film industry is true but not the most significant outcome of the formation of the SMPTE. However, the second option is certainly the most significant outcome as SMPTE is the most organized system of film technology, development, and distribution. And the other two options are also correct but the most significant outcome of the formation of the SMPTE is the second option.

7 0
2 years ago
1. In which generation were semiconductor memories used for the first time:
Llana [10]

1: D. Third Generation

2: C. 10

4 0
3 years ago
Martha is developing a software program in C++ and has a question about how to implement a particular feature. She performs an o
VLD [36.1K]

Answer:

A blog

Explanation:

A blog is a regularly updated website or web page, typically one run by an individual or small group, that is organised by posts.

7 0
3 years ago
1. The Bank manager is imposing a 10% interest rate on the new salary loan to every account in the BPI Family Bank. (ANSWER SHOU
andriy [413]

Hi, you've asked an incomplete question. However, I inferred you want to know the type of accounting activity involved in this process.

Answer:

<u>CALCULATING</u>

Explanation:

The process of imposing a 10% interest rate of course would require <em>calculating </em>how much cash value is to be deducted from the "new salary loan" of the respective accounts in the "BPI Family Bank".

This process in accounting often involves computing the individual loan amount multiplied by the interest percentage. For example, a 10% interest rate on a salary loan of $2000 would be \frac{10}{100} * 2000 = $200

8 0
2 years ago
Do u like five nights at Freddy's? and is it good or bad?​
Murljashka [212]

Answer:

its bad

Explanation:

6 0
3 years ago
Read 3 more answers
Other questions:
  • What is a “spoof” of an ad ?
    8·2 answers
  • When are numbered lists generally used?
    14·2 answers
  • All of the following are examples of a web application except for ______.
    12·2 answers
  • Write a loop that continually asks the user what pets the user has, until the user enters "rock", in which case the loop ends. I
    12·1 answer
  • Which term means a device that converts one voltage to another?
    13·1 answer
  • If Word finds a potential error in a document, a red, green, or blue wavy underline flags the problem.
    14·1 answer
  • Kim is creating a PowerPoint
    13·1 answer
  • Write a for loop that computes the following sum: 5+10+15+20+...+485+490+495+500. The sum should be placed in a variable sum tha
    7·1 answer
  • To change the name of a field, press and hold or right-click the column heading for the field, tap or click ____ on the shortcut
    7·1 answer
  • Because his father _____ his ten-speed bike away to punish him for his failing grades, the boy sulked for two days.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!