Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8591433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:31:39+00:00 2026-06-11T23:31:39+00:00

I am pretty much finished with this code but I can’t get the letter

  • 0

I am pretty much finished with this code but I can’t get the letter “t” — lower case and upper case — to be replaced by a space. Tho format of my code should be the same but I just need help replacing the “t” with a space. For example, “The book on the table thttg” should look like ” he book on he able h g.” So, pretty much the “t” should be hidden.

def remoeT(aStr):
    userInput = ""
    while True:
        string = raw_input("Enter a word/sentence you want to process:")
        if string == "Quit":
            return userInput

        userInput = userInput + string
        if aStr != False:
            while "t" in userInput:
                index = userInput.find("t")
                userInput = userInput[:index] + userInput[index+1:]
        while "T" in userInput:
            index = userInput.find("T")
            userInput = userInput[:index] + userInput[index+1:]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:31:40+00:00Added an answer on June 11, 2026 at 11:31 pm

    To replace all occurrences of t and T with a space in the string input, use the following:

    input = input.replace('t', ' ').replace('T', ' ')
    

    Or with regular expressions:

    import re
    input = re.sub('[tT]', ' ', input)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty much the same as this question. But I can't seem to get this
I've pretty much finished coding a SIC assembler for my systems programming class but
Pretty much what it says on the tin. I've tried googling around but can't
I have pretty much finished my first working Symbian application, but in my hastened
Pretty much all the apps I use on a regular basis implement this 'seemly
Title pretty much describes it, I just need to get all the order numbers
this pretty much is the thing. When in tinymce I press anything that is
I have pretty much finished my first WPF project after several weeks. Now I
I'm working on a library project which is pretty much finished. So I'm giving
Pretty much, I'm writing a program that will run the same code on each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.