import re street = '21 Ramkrishna Road' print(re.sub('Road$', 'Rd.', street))