Avatar ·

While cycle "Summer of the number of numbers"

📁 python, ии

Python began to study, sometimes terrible stupids attack.
A number of tasks with this cycle, it seems, is solved and understandable,
I can’t understand how to formulate the solution?

Determine the sum of all elements of the sequence of 0.
in this and next tasks of the number following the zero, not the following. They are taken into account.
Def there was no one on this course, I do not know what it is.
i.e. The problem must be solved in the framework of the studied material:

  1. input-output, arithmetic operations
  2. conditional instruction
  3. operations with entire and material numbers
  4. cycle for
  5. lines
  6. the While
  7. that's just what I did not understand.

      I =  0    when   int  ( input  () & gt;  0 :  i +=  int  ( input  ()   print  (i)     

    but in this case elements are summarized without the first,
    i.e. In the order, as included.

    if I do this,

      i =  0  a =  0    when   int  ( input  () & gt;  0 :  i += "  1    for  j  in   range  ( 0 : a):  a +=  int  ( input  ())   print  (a)     

    then the numbers for the input.
    In general, I understand that I am doing something wrong.