#String operations
str="programmer"
print "r occurs",str.count("r"),"times"
print "g is at:",str.index("g")
print "After replacing m with Y:",str.replace("m","Y")
str1=str.replace("m","Y")
print "Final String:",str1