old_str = "Hello world-Dear and mary, How are you"

new_str = old_str.partition("and")

new_str2 = old_str.rpartition("you")
print(new_str, new_str2)


#output
#('Hello world-Dear ', 'and', ' mary, How are you')
#('Hello world-Dear and mary, How are ', 'you', '')