Most viewed recipes tagged "meta:requires=recipe"http://code.activestate.com/recipes/tags/meta:requires=recipe/views/2014-04-27T17:25:25-07:00ActiveState Code RecipesMonte Carlo Engine : Simple Head Tail Model (Python)
2014-04-27T17:25:25-07:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/578868-monte-carlo-engine-simple-head-tail-model/
<p style="color: grey">
Python
recipe 578868
by <a href="/recipes/users/4166679/">alexander baker</a>
(<a href="/recipes/tags/carlo/">carlo</a>, <a href="/recipes/tags/monte/">monte</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/strategy/">strategy</a>).
Revision 2.
</p>
<p>Wanted to implement something that shows how the simple framework can be used to investigate a basic heads and tail game. The betting strategy can be varied simply by changing the logic in the ontrail() method. This currently tests the double or quits strategy. Run it to see how many </p>
Avoiding having to type long attribute names in interactive use (Python)
2005-10-24T09:43:15-07:00Noel O'Boylehttp://code.activestate.com/recipes/users/2597815/http://code.activestate.com/recipes/440582-avoiding-having-to-type-long-attribute-names-in-in/
<p style="color: grey">
Python
recipe 440582
by <a href="/recipes/users/2597815/">Noel O'Boyle</a>
(<a href="/recipes/tags/shortcuts/">shortcuts</a>).
Revision 3.
</p>
<p>This recipe shows how to add a __getattr__ method to your class that allows you to use shortened forms for attribute names in interactive use.</p>