title: New list longest consecutive streak of values
body: <p>I want program that outputs a list consisting of the longest streak of consecutive occurrences of the same value in L in PYTHON.</p>
  
  <p>In case multiple values have the equal number of streak, smallest value is chosen.</p>
  
  <p>Input:</p>
  
  <pre><code>L=[2,4,3,3,3,5,6,7,7,7]
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>R=[3,3,3]
  </code></pre>
  
  <p>Code</p>
  
  <pre><code>R = L
  i=0
  for i in range(len(L)-1):
      if L[i]==L[i+1]:
      R=[L[i],L[i+1]]
      i=i+1
      else:
      R=[]
  print('\nThe longest streak of the same value is:')
  print('  ', R)
  </code></pre>