• anonymous
MOOC handout 2 sec 2.10 (#2) Write a list comprehension that prints out the possible results of two coin flips (one result would be ’ht’). I'm stuck on how to even begin this code, I know that it should output 4 different results (ht,tt,hh,th) but that is it. Could anyone give me a hint?
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
  • katieb
I got my questions answered at in under 10 minutes. Go to now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly


Get your free account and access expert answers to this
and thousands of other questions

  • anonymous
A hint: You need an inner and outer loop in the list comprehension - with the outer loop controlling one of the flips and the inner loop controlling the other.
  • anonymous
awesome, got it..didn't think it would be that easy! thank you

Looking for something else?

Not the answer you are looking for? Search for more explanations.