title: Using python for loop inside brackets
body: <p>Actually I encounter one code today which is shown below:</p>
  
  <pre><code>def solution(ar,n):
      d={i: ar[i] for i in range(n)}
      for i in range(n-1):
          for j in range(i+1,n-1):
              if(ar[i]+ar[j]) in d.values():
                  return "Yes"
          return "No"
  </code></pre>
  
  <p>So in this function I am not able to understand this line of code</p>
  
  <pre><code>d= {i : ar[i] for i in range(n)}
  </code></pre>
  
  <p>Can someone please explain me what this code will do and about this syntax?</p>