title: How to write infinite for loop in Python and make addition to variable from array item?
body: <p>I have a code which is was written in C++.
  I want to convert this to Python 3, but there is some problem that starts from <code>for(;;) </code>
  loop to <code>res+=arr[i]</code>.
  There is my C++ pattern:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;bits/stdc++.h&gt;
  using namespace std;
  
  int main(){
    int n;
    vector&lt;int&gt; arr;
  
    for(;;){
      cin&gt;&gt;n;
      if(n==0) break;
      else arr.push_back(n);
    }
  
    int res = 0;
  
    for(int i=0;i&lt;arr.size();i++){
      res+=arr[i];
    }
  
    cout&lt;&lt;res&lt;&lt;&quot; &quot;&lt;&lt;arr.size();
  
  
    return 0;
  }
  </code></pre>
  <p>And I want to convert to Python 3.</p>
  <pre class="lang-py prettyprint-override"><code>from itertools import count
  
  arr = []
  
  for i in count(0):
    n = int(input())
    if(n==0): break
    else: arr.append(n)
  
  res = 0
  
  for i in arr:
    res+=arr[i]
  
  print(res+&quot; &quot;+len(arr))
  </code></pre>
  <p>So there are several mistakes that are hidden from me because I am coding in C++.</p>