Shortening str.replace() In Python it is often necessary to use str.replace(a,b), however .replace is rather long and feels unnecessary. So is there a shorter alternative to str.replace.

Alternatively is there a similar trick to how you can use r=range for golfing for str.replace?

Example code for golfing

m=input()
f="hello"
print m.replace('t','Ushd')
print m.replace('h','gyhj')
print f.replace('o','%£&amp;')
r=str.replace;print r('abc','b','c')


The magic is real.

Shortening str.replace()