Skip to content

Commit 0881715

Browse files
committed
Fix variable name issue
1 parent d73b863 commit 0881715

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ch08-conditional-logic/9b-challenge-simulate-an-election.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ def run_election(regional_chances):
5555
# Display the probabilities that candidate A or candidate B wins the
5656
# election. Note the probability that B wins can be calculated by
5757
# subtracting the probability that A wins from 1.
58-
print(f"Probability A wins: {num_times_A_wins / num_trials}")
59-
print(f"Probability B wins: {1 - (num_times_A_wins / num_trials)}")
58+
print(f"Probability A wins: {num_times_A_wins / NUM_TRIALS}")
59+
print(f"Probability B wins: {1 - (num_times_A_wins / NUM_TRIALS)}")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy