title: Can anybody explain me print statement in this code?
body: <p>I found this code on internet but I am not able to understand how the print statement is working.</p>
  
  <p>I have already tried to see many answers but none answers it perfectly.</p>
  
  <pre><code>def main():
      n=int(raw_input())
      for i in range(0, 1&lt;&lt;n):
          gray=i^(i&gt;&gt;1)
          print "{0:0{1}b}".format(gray,n),
  
  main()
  </code></pre>