farahm45
farahm45 farahm45
  • 14-03-2020
  • Computers and Technology
contestada

How do you remove a letter in python? I need to remove the letter a in whatever the user enters

Respuesta :

Lissylove
Lissylove Lissylove
  • 14-03-2020

Answer:

One can use replace() inside a loop to check for a bad_char and then replace it with the empty string hence removing it. This is the most basic approach and inefficient on performance point of view.

Explanation:

Call str. replace(old, new) with the character to remove as old and the empty string "" as new . Assign the resultant string to the original string's variable. Use a loop to iterate through a string of multiple specific characters and remove them

Answer Link

Otras preguntas

Solve the system by substitution. -3x+3=y -x+3y=29
On an assembly line, 1/5 of an item is made in 3/4 of an hour. What is the unit rate? A 320itemhourB 415itemhourC 334itemhourD 623itemhour
If you were looking at the life cycle of a plant, you would find more specialized cells in what stage? A. a mature plant B. the seed C. an immature plant D. the
Which is an equation? A. 45/x B. 20x = 200 C. 17 + x D. 90 − x
Find the length of the leg x of the right triangle shown below.
help pleasesolve for x​
What ASAP means pls I don’t no that’s mean "
Please help I need it..
The school play was last night and a total of 100 tickets were sold. Each student ticket was $2 and each adult ticket was $4, and a total of $290 was collected
Why do bears in Yellowstone eat elk calve