[Solved] How to make sure the beginning of two strings match until the last word(s)? [closed]

[ad_1]

Remove the last word from success and assign to failure:

import re

success = "Today's day is Wednesday";
failure = re.sub(r'\w+$', '', success)

[ad_2]

solved How to make sure the beginning of two strings match until the last word(s)? [closed]