title: can a condition be in range in python?
body: <p>can a range have a condition in python? for example, I wanna start at position 0 but I want it to run until my while statement is fulfilled.</p>
  
  <pre><code>total = 0
  num = int(input ( "Enter a number: " ))
  range[0,while num != 0:]
  total += num
  </code></pre>
  
  <p>I want to be able to save different variables being in a while loop.
  The purpose of my program is to print the sum of the numbers you enter unil you put in 0</p>
  
  <p><strong>my code</strong></p>
  
  <pre><code>num = int(input ( "Enter a number: " )) #user input
  number_enterd = str() #holds numbers enterd
  total = 0 #sum of number
  
  while num != 0:
      total += num
  
      num = int(input ( "Enter a number: " ))
  
      number_enterd = num
  
  
  print( "Total is =", total ) 
  print(number_enterd) #check to see the numbers ive collected
  </code></pre>
  
  <hr>
  
  <p>expected output:
  enter an integer number (0 to end): 10
  1+2+3+4+5+6+7+8+9+10 = 55</p>
  
  <hr>
  
  <p>as of right now I'm trying to figure out how to store different variables so i can print them before the total is displayed. but since it is in a loop, the variable just keeps getting overwritten until the end.</p>