Given this string, ###hi##python##python###, how can I remove all instances of '#'?
v = "###hi#python#python###"
x = v.strip("#")
print(x)
Expected output: "hipythonpython"
Given this string, ###hi##python##python###, how can I remove all instances of '#'?
v = "###hi#python#python###"
x = v.strip("#")
print(x)
Expected output: "hipythonpython"
Just use replace
the_str = '###hi##python##python###'
clean_str = the_str.replace('#','')
print(clean_str)
Output
hipythonpython
What you want is not strip, but replace:
v = '###hi#python#python###'
x = v.replace('#', '')
print(x)
Output:
hipythonpython