# replace in Python, works like search and replace in word processor
greet = 'Hello Bob'
nstr1 = greet.replace('Bob', 'Jane')
print(nstr1) # Output: Hello Jane
# Initial string doesn't change
print(greet)
# replaces all occurrences of the sub string
nstr2 = greet.replace('o', 'X')
print(nstr2) # Output: HellX BXb
# We can do replace only for number of times
nstr3 = greet.replace('o', 'O', 1)
print(nstr3) # Output: HellO Bob