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

  • Home
  • SEARCH
  • 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 3724768
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:45:39+00:00 2026-05-19T06:45:39+00:00

I have no idea about how I explain this, but here goes… >>> x

  • 0

I have no idea about how I explain this, but here goes…

>>> x = 'qwertyHelloWorldasdfg'
>>> x = inversereplace(x, 'HelloWorld', 'a')
>>> print x  
aaaaaaHelloWorldaaaaaa  

>>> y = 'qwertyHelloWorld'
>>> y = inversereplace(y, 'qwerty', '')
>>> print y
qwerty

In the function above, it replaces everything in x that is not Not the 2nd argument with the 3rd Argument.
How would I go about doing this?
If there is already a function that does this then please let me know.

Thanks in advance,
~DragonXDoom

  • 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-05-19T06:45:40+00:00Added an answer on May 19, 2026 at 6:45 am

    This should work:

    def inversereplace(text, word, repl):
        parts = text.split(word)
        return word.join(repl*len(x) for x in parts)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a good idea about Agile development process but I have no ieda
Anyone have idea about how to bind Boolean in sqlite with objective - c.
I missed my workspace in which I was working. Any one have idea about
Anyone have any idea about CASlotProxy Class in Cocoa (iOS SDK)? I found it
Please let me know if you have any idea about it. Thanks EDIT What
I want to use a vertical UISlider . I have no idea about how,
Brief Idea about the flow : I have say minimum 1 and maximum 18
I have a very little idea about what database file system is. Can somebody
Anyone have any idea how I would go about converting a timestamp in milliseconds
i have a couple questions about an idea i have to manage a form

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.