Adding user input to a dictionary
<p>I've been attempting this for the last couple of hours and I just can't get the code right. I want to read in user input (e.g. 'red', 'blue', 'green', 'red') and spit out the colour and the count of that colour in a dictionary.</p>

<p>Here is my code - I know something is definitely not right with it especially in setting up the dictionary (it also has a while loop to continually ask for input until a blank is entered by the user)</p>

<p>INPUT: 'red', 'blue', 'green', 'red'</p>

<pre><code>dict = {}
car_colours = input("Car: ")
frequency = 0
  while car_colours != '':
  dict['frequency'] = car_colours.count(car_colours)
  dict['colours'] = car_colours
  frequency = frequency + 1
  car_colours = input("Car: ")
print(dict)
</code></pre>

<p>I also assume I need a for loop to get the desired output below?</p>

<p>DESIRED OUTPUT</p>

<pre><code>Cars that are red: 2
Cars that are blue: 1
</code></pre>

<p>I'm not actually even sure I even need this code in what I have above:</p>

<pre><code>frequency = 0
frequency = frequency + 1
</code></pre>

<p>Thanks for any help!</p>