import string
old_str = '''
One
Two
One
Two
One
Two
One
Two
One
Two
One
Two
'''
print "Old String",old_str
print "\n\n"
new_string = string.replace(old_str,'One','1')
print "New String",new_string
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.