Aim : To replace the given string using the alternative string using python Source Code: stringvariable=raw_input("Enter a string :") stringvariable=stringvariable.replace("a", "@") stringvariable=string.replace("A", "@") print("After Replace:") print(stringvariable) Output: Enter a string: Orange After Replace: Or@nge Explanation : The replace function replaces all occurrences of "a" and "A" to "@" and store it back in the variable Also Seen : How to Extract Domain From Mail id Using Python What are the applications of Regex? What is Regex? Thanks and regards, Google Bird