title: Find the mode of a list of numbers in python
body: <pre><code>dictionary={}
  list=[1,1,2,3,3,4,5]
  maximum=0
  for values in list:
     if values in dictionary:
        dictionary[values]+=1
     else:
        dictionary[values]=1
  if not maximum or dictionary[values]&gt;maximum[0]:
  maximum=(values,dictionary[values])
  mode=maximum[0]
  print("Mode:",mode)
  </code></pre>
  
  <p>Output:3</p>
  
  <p>The output should be 1 and 3 since both occur twice.</p>