I'm trying to make a simple program that can find the frequency of occurrences in a text file line by line. I have it outputting everything correctly except for when more than one word is on a line in the text file. (More information below)

The text file looks like this:

```
Hello
Hi
Hello
Good Day
Hi 
Good Day
Good Night

```

I want the output to be: (Doesn't have to be in the same order)

```
Hello: 2
Hi: 2
Good Day: 2
Good Night: 2

```

What it's currently outputting:

```
Day: 2
Good: 3
Hello: 2
Hi: 2
Night: 1

```

My code:

```
file = open("test.txt", "r") 
text = file.read() #reads file (I've tried .realine() & .readlines()

word_list = text.split(None)
word_freq = {}  # Declares empty dictionary

for word in word_list:
    word_freq[word] = word_freq.get(word, 0) + 1
    keys = sorted(word_freq.keys())

for word in keys:
    final=word.capitalize()
    print(final + ': ' + str(word_freq[word])) # Line that prints the output

```