You could use str.replace():
string1 = "Today I went to the (market) to pick up some (fruit)."
string2 = "Today I went to (school) to learn (algebra) and science."
word_dict = {'market': 'library', 'fruit': 'books', 'school': 'class', 'algebra': 'calculus'}
for word, translation in word_dict.items(): # Use word_dict.iteritems() for Python 2
string1 = string1.replace('(' + word + ')', translation)
string2 = string2.replace('(' + word + ')', translation)
You could also use str.format() if you can control the initial strings to use {} instead of ():
string1 = "Today I went to the {market} to pick up some {fruit}."
string2 = "Today I went to {school} to learn {algebra} and science."
word_dict = {'market': 'library', 'fruit': 'books', 'school': 'class', 'algebra': 'calculus'}
string1 = string1.format(**word_dict)
string2 = string2.format(**word_dict)
If you can't control the initial output, but would like to use str.format() anyways, you can replace any occurrences of ( and ) with { and }:
string1 = string1.replace('(', '{').replace(')', '}').format(**word_dict)
string2 = string2.replace('(', '{').replace(')', '}').format(**word_dict)
Or to do the same in a much cleaner way, you can use str.translate() along with str.maketrans():
trd = str.maketrans('()', '{}')
string1 = string1.translate(trd).format(**word_dict)
string2 = string2.translate(trd).format(**word_dict)
Keep in mind that this will replace any parenthesis with curly brackets even if they're not surrounding a word you want to replace. You could reverse translate the remaining curly brackets using rev_trd = str.maketrans('{}', '()') after you've formatted the string; but usually at that point you're better off just using the for loop and str.replace() as shown in the first code section. Unless you can change the initial strings to just contain curly brackets, then use that.
(word)s replaced with{word}?