title: Can anyone explain me what this Python 3 command do?
body: <p>I am a <strong>beginner</strong> in Python programming. I have checked what the methods does separately, but not getting as a whole. Here is a program was written as a answer for the problem: 
  <em>Write a program to print all elements of an array in reverse order</em>:</p>
  
  <pre><code>if __name__ == '__main__':                          #1   
      n = int(input())                                #2
                                                      #3
      arr = list(map(int, input().rstrip().split()))  #4
      for i in range(n):                              #5
          print(arr[-i-1],end=' ')                    #6
  </code></pre>
  
  <p>I am not getting line 4. Can anyone explain step by step what that line is doing? How they are working and giving the output as a whole? The inputs were separated by space:</p>
  
  <pre><code>5            #length of the array
  1 2 3 4 5     #inputs separated by space
  </code></pre>