Answer:
The output is attached below
Step-by-step explanation:
d = {}
while True:
line = input("Enter line: ")
if len(line)==0:
break
token = line.split(' ')
for var in token:
try:
if len(var)==0:
continue
count = d[var]
d[var] = count + 1
except KeyError:
d[var] = 1
pass
for word in sorted(d):
print(word , d[word])
------------------