title: Iterations in python
body: <p>For example, for 
  <strong>[p1,p2,p3]</strong>=<strong>[0.4,0.3,0.8]</strong>, and k=2. The 2-subsets of 
  {1,2,3}
  and the corresponding probabilties that 
  Xi
  is one iff i
  is in the subset are</p>
  
  <p>{1,2} = 0.024 = <strong>(0.4x0.3x(1-0.8))</strong></p>
  
  <p>{1,3} = 0.224 = <strong>(0.4x0.8x(1-0.3))</strong></p>
  
  <p>{2,3} = 0.144 = <strong>(0.3x0.8x(1-0.4))</strong></p>
  
  <p>{1,2}=0.024</p>
  
  <p>{1,3}=0.224</p>
  
  <p>{2,3}=0.144
  hence,</p>
  
  <p><strong>P(X=k)=0.024+0.224+0.144=0.392.</strong></p>
  
  <p>What will be the <strong>python code</strong> for this? I tried using itertools.combination but it 
  showing <strong>itertools.combinations object at 0x00000218F0129A48</strong></p>