title: Python loop (for or while) to add keep adding values from a list as long as they don't exceed a given condition
body: <p>please help. I am trying to write a loop that will take values from a list <code>mylist = [3,4,7,10,6,8]</code> and keep adding them as long as the sum does not exceed 24.</p>
  <pre><code>myvar = 0
  mylist = [3,4,7,10,6,8]
  
  while myvar &lt;= 24:
   print(myvar)
   for i in mylist:
    myvar+=i
    print(myvar)enter code here
  </code></pre>
  <p>what am I doing wrong here?
  Thank you in advance</p>