View the step-by-step solution to:

Looking to solve for the following problem in Python: Ask the user to input a line of text, and a character ch. Your program should:

Looking to solve for the following problem in Python:


Ask the user to input a line of text, and a character ch. Your program should:

Find a string variable that contains the text after removing all occurrences of the character ch from the input text.

Print that string.

For example, an execution would look like:

Please enter a line of text: This is a line of text.

Please enter the character you want to remove: s

Thi i a line of text.

Your program should check to make sure that the user only entered one character for the second input. If they enter more than one character, they should be made to enter the character again. For example:

Please enter a line of text: This is a line of text.

Please enter the character you want to remove: the

Please enter the character you want to remove: s

Thi i a line of text.

Lastly, your program should be case insensitive. For example:

Please enter a line of text: This is a line of text.

Please enter the character you want to remove: t

his is a line of ex.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question