Project 1: Hog Test Cases
For reference, here are copies of the test cases provided:
Phase 1: Simulator
Tests - Question 0
Question 0 > Suite 1 > Case 1
>>> from hog import *
>>> test_dice = make_test_dice(4, 1, 2)
>>> test_dice()
______
>>> test_dice() # Second call
______
>>> test_dice() # Third call
______
>>> test_dice() # Fourth call
______
Tests - Question 1
Question 1 > Suite 1 > Case 1
>>> from hog import *
>>> roll_dice(2, make_test_dice(4, 6, 1))
______
---------------------------------------------------------------------
Question 1 > Suite 1 > Case 2
>>> from hog import *
>>> roll_dice(3, make_test_dice(4, 6, 1))
______
---------------------------------------------------------------------
Question 1 > Suite 1 > Case 3
>>> from hog import *
>>> roll_dice(3, make_test_dice(1, 2, 3))
______
---------------------------------------------------------------------
Question 1 > Suite 1 > Case 4
>>> from hog import *
>>> roll_dice(4, make_test_dice(1, 2, 3))
______
---------------------------------------------------------------------
Question 1 > Suite 1 > Case 5
>>> from hog import *
>>> counted_dice = make_test_dice(4, 1, 2, 6)
>>> roll_dice(3, counted_dice)
______
>>> roll_dice(1, counted_dice) # Make sure you call dice exactly num_rolls times!
______
---------------------------------------------------------------------
Question 1 > Suite 2 > Case 1
>>> from hog import *
>>> roll_dice(5, make_test_dice(4, 2, 3, 3, 4, 1))
16
---------------------------------------------------------------------
Question 1 > Suite 2 > Case 2
>>> from hog import *
>>> roll_dice(2, make_test_dice(1))
2
---------------------------------------------------------------------
Question 1 > Suite 2 > Case 3
>>> from hog import *
>>> dice = make_test_dice(5, 4, 3, 2, 1)
>>> roll_dice(1, dice) # Roll 1 (5)
5
>>> roll_dice(4, dice) # Reset (4, 3, 2, 1)
1
>>> roll_dice(2, dice) # Roll 2 (5, 4)
9
>>> roll_dice(3, dice) # Reset (3, 2, 1)
1
>>> roll_dice(3, dice) # Roll 3 (5, 4, 3)
12
>>> roll_dice(2, dice) # Reset (2, 1)
1
>>> roll_dice(4, dice) # Roll 4 (5, 4, 3, 2)
14
>>> roll_dice(1, dice) # Reset (1)
1
>>> roll_dice(5, dice) # Roll 5 (5, 4, 3, 2, 1)
1
>>> roll_dice(10, dice) # Roll 10 (5, 4, 3, 2, 1, 5, 4, 3, 2, 1)
2
Tests - Question 2
Question 2 > Suite 1 > Case 1
>>> from hog import *
>>> take_turn(2, 0, make_test_dice(4, 6, 1))
______
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 2
>>> from hog import *
>>> take_turn(3, 0, make_test_dice(4, 6, 1))
______
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 3
>>> from hog import *
>>> take_turn(0, 35)
______
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 4
>>> from hog import *
>>> take_turn(0, 71)
______
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 5
>>> from hog import *
>>> take_turn(0, 7)
______
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 6
>>> from hog import *
>>> take_turn(0, 0)
______
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 7
>>> from hog import *
>>> take_turn(2, 0, make_test_dice(6))
12
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 8
>>> from hog import *
>>> take_turn(1, 0, make_test_dice(3)) # Remember Hogtimus Prime!
______
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 9
>>> from hog import *
>>> take_turn(2, 0, make_test_dice(2, 3, 5))
7
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 10
>>> from hog import *
>>> take_turn(1, 0, make_test_dice(2))
3
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 11
>>> from hog import *
>>> take_turn(0, 60)
11
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 12
>>> from hog import *
>>> take_turn(0, 10)
3
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 13
>>> from hog import *
>>> take_turn(0, 24)
7
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 14
>>> from hog import *
>>> take_turn(10, 0, make_test_dice(5)) # Remember When Pigs Fly!
15
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 15
>>> from hog import *
>>> take_turn(9, 0, make_test_dice(4))
16
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 16
>>> from hog import *
>>> take_turn(8, 0, make_test_dice(4))
17
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 17
>>> from hog import *
>>> take_turn(7, 0, make_test_dice(4))
18
---------------------------------------------------------------------
Question 2 > Suite 1 > Case 18
>>> from hog import *
>>> take_turn(6, 0, make_test_dice(4))
19
---------------------------------------------------------------------
Question 2 > Suite 2 > Case 1
>>> import hog
>>> def roll_dice(num_rolls, dice):
... print("Called roll dice!")
... return 9002
...
>>> hog.roll_dice, old_roll_dice = roll_dice, hog.roll_dice
>>> hog.take_turn(5, 0) # Make sure you call roll_dice!
Called roll dice!
20
>>> hog.roll_dice = old_roll_dice
Tests - Question 3
Question 3 > Suite 1 > Case 1
>>> from hog import *
>>> test_dice = reroll(make_test_dice(2, 4, 6))
>>> test_dice()
______
>>> test_dice()
______
>>> test_dice()
______
>>> test_dice()
______
---------------------------------------------------------------------
Question 3 > Suite 1 > Case 2
>>> from hog import *
>>> test_dice = reroll(make_test_dice(1, 3, 5))
>>> test_dice()
______
>>> test_dice()
______
>>> test_dice()
______
>>> test_dice()
______
---------------------------------------------------------------------
Question 3 > Suite 1 > Case 3
>>> from hog import *
>>> test_dice = reroll(make_test_dice(3, 2, 4, 1, 5))
>>> test_dice()
______
>>> test_dice()
______
>>> test_dice()
______
>>> test_dice()
______
---------------------------------------------------------------------
Question 3 > Suite 1 > Case 4
>>> from hog import *
>>> test_dice = reroll(make_test_dice(1, 1, 1, 1, 2))
>>> test_dice()
1
>>> test_dice()
1
>>> test_dice()
2
>>> test_dice()
1
Tests - Question 4
Question 4 > Suite 1 > Case 1
>>> from hog import *
>>> select_dice(4, 24, False).__name__ == 'rerolled'
True
>>> select_dice(16, 64, False).__name__ == 'rerolled'
False
>>> select_dice(0, 0, True).__name__ == 'rerolled'
True
>>> select_dice(50, 80, True).__name__ == 'rerolled'
False
---------------------------------------------------------------------
Question 4 > Suite 1 > Case 2
>>> from hog import *
>>> select_dice(4, 25, False) == six_sided
True
>>> select_dice(3, 4, False) == six_sided
False
>>> select_dice(0, 0, True) == six_sided
False
>>> select_dice(60, 80, True) == six_sided
False
---------------------------------------------------------------------
Question 4 > Suite 1 > Case 3
>>> from hog import *
>>> select_dice(4, 25, False) == four_sided
False
>>> select_dice(3, 4, False) == four_sided
False
>>> select_dice(0, 0, True) == four_sided
False
>>> select_dice(50, 80, True) == four_sided
True
Tests - Question 5
Question 5 > Suite 1 > Case 1
Q: The variables score0 and score1 are the scores for both
players. Under what conditions should the game continue?
Choose the number of the correct choice:
0) While score0 is less than goal
1) While score0 and score1 are both less than goal
2) While score1 is less than goal
3) While at least one of score0 or score1 is less than goal
______
---------------------------------------------------------------------
Question 5 > Suite 1 > Case 2
Q: If strategy1 is Player 1's strategy function, score0 is
Player 0's current score, and score1 is Player 1's current
score, then which of the following demonstrates correct
usage of strategy1?
Choose the number of the correct choice:
0) strategy1(score0, score1)
1) strategy1(score1, score0)
2) strategy1(score1)
3) strategy1(score0)
______
---------------------------------------------------------------------
Question 5 > Suite 2 > Case 1
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Play function stops at goal
>>> s0, s1 = hog.play(always_roll(5), always_roll(3), score0=91, score1=10)
>>> s0
106
>>> s1
10
---------------------------------------------------------------------
Question 5 > Suite 2 > Case 2
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Goal score is not hardwired, Hog Wild, When Pigs Fly
>>> s0, s1 = hog.play(always_roll(5), always_roll(5), goal=10)
>>> s0
20
>>> s1
0
---------------------------------------------------------------------
Question 5 > Suite 2 > Case 3
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Swine Swap
>>> s0,s1 = hog.play(always_roll(5), always_roll(3), score0=5, score1=40, goal=50)
>>> s0
55
>>> s1
29
---------------------------------------------------------------------
Question 5 > Suite 3 > Case 1
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Swine swap applies to 3 digit scores
>>> s0, s1 = hog.play(always_roll(5), always_roll(3), score0=95, score1=55)
>>> s0
55
>>> s1
110
---------------------------------------------------------------------
Question 5 > Suite 3 > Case 2
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Goal edge case
>>> s0, s1 = hog.play(always_roll(4), always_roll(3), score0=88, score1=20)
>>> s0
100
>>> s1
20
---------------------------------------------------------------------
Question 5 > Suite 3 > Case 3
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Player 1 win
>>> s0, s1 = hog.play(always_roll(2), always_roll(4), score0=87, score1=88)
>>> s0
97
>>> s1
100
---------------------------------------------------------------------
Question 5 > Suite 3 > Case 4
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Check strategies are actually used correctly
>>> strat0 = lambda score, opponent: opponent % 10
>>> strat1 = lambda score, opponent: opponent // 10
>>> s0, s1 = hog.play(strat0, strat1, score0=40, score1=92)
>>> s0
102
>>> s1
62
---------------------------------------------------------------------
Question 5 > Suite 3 > Case 5
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Swine swap applies during Player 1 turn
>>> s0, s1 = hog.play(always_roll(5), always_roll(5), score0=40, score1=95)
>>> s0
110
>>> s1
55
---------------------------------------------------------------------
Question 5 > Suite 3 > Case 6
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Free bacon refers to correct opponent score
>>> s0, s1 = hog.play(always_roll(0), always_roll(0), score0=11, score1=99)
>>> s0
21
>>> s1
104
---------------------------------------------------------------------
Question 5 > Suite 3 > Case 7
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Handle multiple turns
>>> s0, s1 = hog.play(always_roll(0), always_roll(0))
>>> s0
101
>>> s1
98
---------------------------------------------------------------------
Question 5 > Suite 3 > Case 8
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> # Handle multiple turns
>>> s0, s1 = hog.play(always_roll(5), always_roll(0))
>>> s0
110
>>> s1
47
---------------------------------------------------------------------
Question 5 > Suite 4 > Case 1
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> hog.four_sided = hog.make_test_dice(1)
>>> # Assume that six-sided dice are in play
>>> s0, s1 = hog.play(always_roll(-1), always_roll(3), score0=98, score1=91)
>>> s0
100
>>> s1
96
---------------------------------------------------------------------
Question 5 > Suite 4 > Case 2
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> hog.four_sided = hog.make_test_dice(1)
>>> # Assume that six-sided dice are in play
>>> s0, s1 = hog.play(always_roll(-1), always_roll(3), score0=97, score1=90)
>>> s0
99
>>> s1
104
---------------------------------------------------------------------
Question 5 > Suite 4 > Case 3
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> hog.four_sided = hog.make_test_dice(1)
>>> # Assume that six-sided dice are in play
>>> s0, s1 = hog.play(always_roll(-1), always_roll(3))
>>> s0
13
>>> s1
101
---------------------------------------------------------------------
Question 5 > Suite 4 > Case 4
>>> import hog
>>> always_roll = hog.always_roll
>>> hog.reroll = lambda d: hog.make_test_dice(5)
>>> hog.six_sided = hog.make_test_dice(3)
>>> hog.four_sided = hog.make_test_dice(1)
>>> # Assume that six-sided dice are in play
>>> s0, s1 = hog.play(always_roll(2), always_roll(-1))
>>> s0
104
>>> s1
20
---------------------------------------------------------------------
Question 5 > Suite 5 > Case 1
>>> # Fuzz Testing
>>> # Plays a lot of random games, and calculates a secret value.
>>> # Failing this test means something is wrong, but you should
>>> # look at other tests to see where the problem might be.
>>> # Hint: make sure you're only calling take_turn once per turn!
>>> import hog, importlib
>>> importlib.reload(hog)
...module 'hog' from '.../hog/hog.py'...
>>> import tests.play_utils
>>> tests.play_utils.check_play_function(hog)
Phase 2: Strategies
Tests - Question 6
Question 6 > Suite 1 > Case 1
>>> from hog import *
>>> # If this causes an error, write AssertionError
>>> check_strategy(always_roll(5)) == None
______
---------------------------------------------------------------------
Question 6 > Suite 1 > Case 2
>>> from hog import *
>>> def fail_15_20(score, opponent_score):
... if score == 15 and opponent_score == 20:
... return 100
... return 5
>>> # If this causes an error, write AssertionError
>>> check_strategy(fail_15_20) == None
______
---------------------------------------------------------------------
Question 6 > Suite 1 > Case 3
>>> from hog import *
>>> def fail_102_115(score, opponent_score):
... if score == 102 and opponent_score == 115:
... return 100
... return 5
>>> fail_102_115 == check_strategy(fail_102_115, 120)
AssertionError
---------------------------------------------------------------------
Question 6 > Suite 1 > Case 4
>>> from hog import *
>>> # Make sure that you check all valid pairs of scores!
>>> # Scores can range from 0 to the goal score for both players.
>>> all_scores = set()
>>> def check_completeness(score, opponent_score):
... all_scores.add((score, opponent_score))
... return 5
>>> # Be specific about the error type (AssertionError, rather than Error)
>>> check_strategy(check_completeness)
>>> count = 0
>>> for score in range(100):
... for opponent_score in range(100):
... if (score, opponent_score) in all_scores:
... count += 1
>>> count
10000
Tests - Question 7
Question 7 > Suite 1 > Case 1
>>> from hog import *
>>> dice = make_test_dice(3, 1, 5, 6)
>>> averaged_dice = make_averaged(dice, 1000)
>>> # Average of calling dice 1000 times
>>> averaged_dice()
______
---------------------------------------------------------------------
Question 7 > Suite 1 > Case 2
>>> from hog import *
>>> dice = make_test_dice(3, 1, 5, 6)
>>> averaged_roll_dice = make_averaged(roll_dice, 1000)
>>> # Average of calling roll_dice 1000 times
>>> # Enter a float (e.g. 1.0) instead of an integer
>>> averaged_roll_dice(2, dice)
______
---------------------------------------------------------------------
Question 7 > Suite 2 > Case 1
>>> from hog import *
>>> hundred_range = range(1, 100)
>>> hundred_dice = make_test_dice(*hundred_range)
>>> averaged_hundred_dice = make_averaged(hundred_dice, 5*len(hundred_range))
>>> correct_average = sum(range(1, 100)) / len(hundred_range)
>>> averaged_hundred_dice()
50.0
>>> averaged_hundred_dice()
50.0
Tests - Question 8
Question 8 > Suite 1 > Case 1
Q: If multiple num_rolls are tied for the highest scoring
average, which should you return?
Choose the number of the correct choice:
0) A random num_rolls
1) The highest num_rolls
2) The lowest num_rolls
______
---------------------------------------------------------------------
Question 8 > Suite 2 > Case 1
>>> from hog import *
>>> dice = make_test_dice(1) # dice always returns 1
>>> max_scoring_num_rolls(dice, num_samples=1000)
______
---------------------------------------------------------------------
Question 8 > Suite 2 > Case 2
>>> from hog import *
>>> dice = make_test_dice(3) # dice always returns 3
>>> max_scoring_num_rolls(dice, num_samples=1000)
10
---------------------------------------------------------------------
Question 8 > Suite 2 > Case 3
>>> from hog import *
>>> dice = make_test_dice(1, 2, 2, 2, 2, 2, 2, 2)
>>> max_scoring_num_rolls(dice, num_samples=1000)
4
---------------------------------------------------------------------
Question 8 > Suite 3 > Case 1
>>> from hog import *
>>> dice = make_test_dice(2) # dice always rolls 2
>>> max_scoring_num_rolls(dice, num_samples=1000)
______
---------------------------------------------------------------------
Question 8 > Suite 3 > Case 2
>>> from hog import *
>>> dice = make_test_dice(1, 2) # dice alternates 1 and 2
>>> max_scoring_num_rolls(dice, num_samples=1000)
______
---------------------------------------------------------------------
Question 8 > Suite 3 > Case 3
>>> from hog import *
>>> dice = make_test_dice(1, 2, 3, 4, 5) # dice sweeps from 1 through 5
>>> max_scoring_num_rolls(dice, num_samples=1000)
3
Tests - Question 9
Question 9 > Suite 1 > Case 1
>>> from hog import *
>>> bacon_strategy(0, 0, margin=8, num_rolls=5)
______
---------------------------------------------------------------------
Question 9 > Suite 1 > Case 2
>>> from hog import *
>>> bacon_strategy(70, 50, margin=8, num_rolls=5)
______
---------------------------------------------------------------------
Question 9 > Suite 1 > Case 3
>>> from hog import *
>>> bacon_strategy(50, 70, margin=8, num_rolls=5)
______
---------------------------------------------------------------------
Question 9 > Suite 1 > Case 4
>>> from hog import *
>>> bacon_strategy(32, 4, margin=5, num_rolls=4)
0
---------------------------------------------------------------------
Question 9 > Suite 1 > Case 5
>>> from hog import *
>>> bacon_strategy(20, 18, margin=9, num_rolls=4)
0
---------------------------------------------------------------------
Question 9 > Suite 1 > Case 6
>>> from hog import *
>>> # Account for hogtimus prime rule
>>> bacon_strategy(20, 20, margin=5, num_rolls=4)
0
---------------------------------------------------------------------
Question 9 > Suite 2 > Case 1
>>> from hog import *
>>> bacon_strategy(20, 4, margin=3, num_rolls=4)
0
---------------------------------------------------------------------
Question 9 > Suite 2 > Case 2
>>> from hog import *
>>> bacon_strategy(20, 23, margin=5, num_rolls=0)
0
---------------------------------------------------------------------
Question 9 > Suite 2 > Case 3
>>> from hog import *
>>> bacon_strategy(20, 24, margin=7, num_rolls=5)
0
---------------------------------------------------------------------
Question 9 > Suite 2 > Case 4
>>> from hog import *
>>> bacon_strategy(20, 25, margin=7, num_rolls=5)
5
---------------------------------------------------------------------
Question 9 > Suite 2 > Case 5
>>> from hog import *
>>> bacon_strategy(20, 26, margin=11, num_rolls=6)
0
Tests - Question 10
Question 10 > Suite 1 > Case 1
>>> from hog import *
>>> swap_strategy(33, 60, 8, 6)
______
---------------------------------------------------------------------
Question 10 > Suite 1 > Case 2
>>> from hog import *
>>> swap_strategy(30, 54, 8, 6)
______
---------------------------------------------------------------------
Question 10 > Suite 1 > Case 3
>>> from hog import *
>>> swap_strategy(7, 23, 8, 6)
6
---------------------------------------------------------------------
Question 10 > Suite 1 > Case 4
>>> from hog import *
>>> swap_strategy(7, 26, 8, 6)
0
---------------------------------------------------------------------
Question 10 > Suite 2 > Case 1
>>> from hog import *
>>> swap_strategy(10, 38, 8, 6) # beneficial
0
---------------------------------------------------------------------
Question 10 > Suite 2 > Case 2
>>> from hog import *
>>> swap_strategy(9, 1, 8, 6)
6
---------------------------------------------------------------------
Question 10 > Suite 2 > Case 3
>>> from hog import *
>>> swap_strategy(35, 28, 8, 6)
0
---------------------------------------------------------------------
Question 10 > Suite 2 > Case 4
>>> from hog import *
>>> swap_strategy(37, 24, 8, 6)
6
Tests - Question 11
Question 11 > Suite 1 > Case 1
>>> import hog
>>> def check_strategy(strat):
... for score in range(100):
... for opp in range(100):
... num_rolls = strat(score, opp)
... if not isinstance(num_rolls, int):
... raise ValueError("final_strategy({0}, {1}) returned {2}, not an int.".format(score, opp, num_rolls))
>>> def max_scoring_num_rolls(dice=lambda: 1):
... raise RuntimeError("Your final strategy should not call max_scoring_num_rolls.")
>>> old_max_scoring_num_rolls = hog.max_scoring_num_rolls
>>> hog.max_scoring_num_rolls = max_scoring_num_rolls
>>> check_strategy(hog.final_strategy)
>>> hog.max_scoring_num_rolls = old_max_scoring_num_rolls
---------------------------------------------------------------------
Question 11 > Suite 2 > Case 1
>>> try:
... from utils import final_win_rate
... except ImportError:
... from tests.utils import final_win_rate
>>> print('\nFinal strategy win rate:', final_win_rate())
>>> final_win_rate() >= 0.60
True
---------------------------------------------------------------------
Question 11 > Suite 3 > Case 1
>>> try:
... from utils import final_win_rate
... except ImportError:
... from tests.utils import final_win_rate
>>> print('\nFinal strategy win rate:', final_win_rate())
>>> final_win_rate() >= 0.65
True
---------------------------------------------------------------------
Question 11 > Suite 4 > Case 1
>>> try:
... from utils import final_win_rate
... except ImportError:
... from tests.utils import final_win_rate
>>> print('\nFinal strategy win rate:', final_win_rate())
>>> final_win_rate() >= 0.70
True
---------------------------------------------------------------------
Question 11 > Suite 4 > Case 1
>>> try:
... from utils import final_win_rate
... except ImportError:
... from tests.utils import final_win_rate
>>> print('\nFinal strategy win rate:', final_win_rate())
>>> final_win_rate() >= 0.75
True