title: Counting occurences of number in a list separated by spaces using dictionaries
body: <p>If I have a list of numbers (ex:- <code>1 2 3 3 2 2 2 1 3 4 5 3</code> ) how can I use dictionaries in python to count the occurrences of each number in the list?
  So the output be something like:</p>
  
  <p>Enter numbers separated by spaces :<code>1 2 3 3 2 2 2 1 3 4 5 3</code></p>
  
  <pre><code>{'1': 2, '3': 4, '2': 4, '5': 1, '4': 1}
  
  1 occurs 2 times
  
  3 occurs 4 times
  
  2 occurs 4 times
  
  5 occurs one time
  
  4 occurs one time 
  </code></pre>
  
  <p>Also if a number occurs only once the output should be  "one time".</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>numbers=input("Enter numbers separated by spaces:-")
  count={}
  for number in numbers:
      if number in count:
          count[number] = count[number]+1
      else:
          count[number] = 1
  
  print(number)
  </code></pre>
  
  <p>but my output ends up being the last number, i, input can someone help me?</p>
  
  <p>OK, this is what I have now:</p>
  
  <pre><code>numbers = input("Enter numbers separated by spaces:-") # i.e. '1 2 3 3 2 2 2 1 3 4 5 3'
  my_list = list(map(int, numbers.strip().split(' ')))
  count = {}
  for x in set(my_list):
     count[x] = my_list.count(x)
  print(count)
  for key, value in count.items():
      if value == 1:
           print('{} occurs one time'.format(key))
      else:
           print('{} occurs {} times'.format(key, value))
  </code></pre>
  
  <p>This is what I have now and it seems pretty good, if theres any way to make it better please do let me know. Thanks a lot everybody</p>