# Python probability calculator

**URL:** <https://forum.freecodecamp.org/t/python-probability-calculator/450407>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [March 10, 2021, 7:17am UTC](https://forum.freecodecamp.org/t/python-probability-calculator/450407 "2021-03-10T07:17:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musfiq](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/musfiq/32/134407_2.png) [@musfiq](https://forum.freecodecamp.org/u/musfiq)\
**Post date:** [March 10, 2021, 7:17am UTC](https://forum.freecodecamp.org/t/python-probability-calculator/450407/1 "2021-03-10T07:17:58Z")

</div>

Hello guys!! I am facing some problems in probability calculator. It’s the experiment function. First of all, I am sorry about not using copy module, I tried But I couldn’t. Secondly, My code seem “OK” enough to solve the problem, and I solved it too. The first probability seem good. But the second probability is always 0.61-0.67.(|In my IDE). But what caught my attention is, the second probability is always going to be “1.0” !!? Are you sure about that?  
Thanks in advance…  
pardon me if I said something wrong.

---

<div class="post-metadata">

**Author:** ![jeremy.a.gray](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremy.a.gray/32/181458_2.png) [@jeremy.a.gray](https://forum.freecodecamp.org/u/jeremy.a.gray)\
**Post date:** [March 10, 2021, 12:21pm UTC](https://forum.freecodecamp.org/t/python-probability-calculator/450407/2 "2021-03-10T12:21:01Z")

</div>

The tests for the project are good. If your code isn’t passing the tests yet, it still needs some work. You can look in the forums for other posts discussing the probability (it’s been calculated). The second one you mention with a probability of 1 is drawing 20 balls from a 19 ball hat (so all of them) and the expected draw is a subset of the available balls, so you would indeed always get the expected draw.

If you have questions about your code or the errors it’s generating, you’ll need to post a link to your code, preferably on repl.it or a similar service so that others can review it.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [September 9, 2021, 12:21am UTC](https://forum.freecodecamp.org/t/python-probability-calculator/450407/3 "2021-09-09T00:21:16Z")

</div>

Closed on September 9, 2021, 12:21am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
