find and replace elements in lookup within file

def f2lookup(f, lookup):
	"""
	find and replace elements in lookup within file
	"""
	lookup = {i: r for i, r in [l.strip().split('\t')[0:2] for l in lookup]}
	for line in f:
		line = line.strip()
		for find, replace in list(lookup.items()):
			line = line.replace(find, replace)
		yield line