def read_ticker():
d = {'1347 Capital Corp.': ('TFSCW', '2014'), '1347 Property Insurance Holdings, Inc.': ('PIH', '2014'),
'1-800 FLOWERS.COM, Inc.': ('FLWS', '1999')}
return d
def ticker():
di = read_ticker()
while True:
try:
name = input("Enter the name of a company: ")
if name == "":
return
print(di[name])
except KeyError:
print("Name not found! Please enter a valid name!")
ticker()
I hope this helps!