Skip to content
Advertisement

replace a symbol in the same line of multistring

I am doing a python project, its a review maker kind using a sample string and replacing the symbol in the same line of the multistring then printing it with (check mark) next to the same text in the string as user input , I have a problem in replacing a certain symbol (☑) with the same line of string which equal to user input. Here is a code example to get the idea:

JavaScript

Advertisement

Answer

You might be looking for something on the lines of :

JavaScript

Another perhaps better method leveraging regular expressions is:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement