Just 10 lines of code.
from functools import reduce
list = []
def compare():
calc = [reduce(lambda a, b: a if a == b else None, x) for x in zip(*list)] + [None]
return list[0][:calc.index(None)]
list.append(input("Enter the first string: "))
list.append(input("Enter the second string: "))
print(compare())