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 brown outline around a frame is an indication of which tool?​
zimovet [89]

Answer:

Direct Selection Tool

Explanation:

The Direct Selection tool is a tool that allows the selection of a single object or a single path such that an object already grouped with other objects can be directly and moved to a desired location

The Direct Selection tool can be used to select a container's content including graphics which are imported and specific points or paths of a figure or text to allow for drawing, text editing or to edit paths.

6 0
3 years ago
Write a 10 sentence paragraph about george washington and abraham lincoln and no plagiarism
Mamont248 [21]
10 sentence paragraph about George Washington and Abraham Lincoln and no playgiarism
8 0
3 years ago
Read 2 more answers
Assume that the ciphertext C is computed from the plaintext P by C= P ⊕ K1 ⊕ K2 , where K1 and K2 are the encryption key and ⊕ d
Sedbober [7]

Answer:

K1 ⊕ K2 = 9

Explanation:

Since 5 ⊕ K = 12, K must be 5 ⊕ 12 = 9.

But there are supposedly two encryptionkeys, we cannot know their individual value, only that K1 ⊕ K2 = 9.

That makes this a bit weird question.

4 0
4 years ago
How many different bit strings are there of length 6 that contain the string 0000?
Elena L [17]

Answer:

It can be 100001, 100000,000001,000000

Hence, answer is 4.

its also can be found through 2C2 *2 = 2!/0! *2 =2*2 =4

Explanation:

The answer is straight forward, we have 2 empty places and we can select from 2 items, and hence its 2C2, and now we can arrange them as well, and since we can arrange in 2 ways, hence a total number of possibility = 2 * 2C2 = 4, which is the required answer.

5 0
3 years ago
Though most of the content on this social network is uploaded by amateurs, many companies offer streaming video content related
Nikitich [7]
The answer to this is the youtube channel. The youtube channel is very common and very popular to everyone. Each and every one of us could not deny that we would watch a video from youtube maybe at least once a day. Youtube is very effective, it is also very efficient and easy to use.
6 0
3 years ago
Other questions:
  • An incorrectly spelled word is indicated by _______. a. a red checkmark beside the word b. the word higlighted in yellow c. a re
    8·2 answers
  • You are starting a spreadsheet, and you would like 500 to appear in cell C3. You should _____.
    11·2 answers
  • Footer is a text or graphis that print at the bottom of every page
    13·1 answer
  • QUESTION 1 _____ is a type of data encryption that enables users of the Internet to securely and privately exchange data through
    14·1 answer
  • Computer-aided manufacturing (CAM) offers which possible benefits?
    15·2 answers
  • Which tab should you choose to add a picture from a file to your presentation?
    8·1 answer
  • The human brain can store both temporary and permanent bits of information. Which type of memory in the computer is similar to t
    6·1 answer
  • What is modularity? Help asap
    9·1 answer
  • What is window system?<br>​
    14·2 answers
  • Question 22 of 25
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!