Given the string “To dance or not to dance”, have the program replace all occurances of the word “dance” with “be”.
My attempt but its having error
word = "To dance or not to dance"
replaceWords = str_replace("dance","be", word)
print (replaceWords)