Python - search and replace vowels in string
Question: i need to write code in Python that will be able to detect if a certain
character in a string is there and replace it with another character of my
choice. for example, i need to replace all vowels in a string with "$&@", so
after the string "hello world" goes through the code, it will turn into
"h$&@ll$&@ w$&@rld". Does anybody know how to do this using very basic python
and not really any pre existing functions? thank you


Answer: Use [re](https://docs.python.org/2/library/re.html) module:

    
    
    import re
    string = "Hello world"
    print(re.sub("a|e|i|o|u", "xx", string))
    

this will print

    
    
    >>> Hxxllxx wxxrld
    

