I have the command below in a .py file
print(r"\n print series")
I want the above command/line to be replaced with a string:
"#series" ie convert the above print command into a comment prefixing the # symbol to the text following the "print" in the command above.
I am new to python. Please help.
This question was closed earlier as it was not clear what I was attempting to do. Hence, the explanation that follows:
The reason for doing this: I want to use print statements in a script for learning python/using as reference. Later, I want to change the print statement into a comment. Hence, I want to replace the beginning of the print statement with a # which will convert it into a comment. As there would be many such conversions, I wanted to do it programmatically using a string.replace or something else. Any suggestions to achieve this in another way are also welcome. Thanks.