Apply suggestions from code review

Co-authored-by: BethanyG <BethanyG@users.noreply.github.com>
This commit is contained in:
Metallifax
2022-02-26 19:05:20 -04:00
committed by BethanyG
parent e5bdf1bb7e
commit 742d0220c6

View File

@@ -1,5 +1,5 @@
def get_rounds(number):
"""Create a list containing the current and next two round numbers.
"""Creates a list containing the current and next two round numbers.
:param number: int - current round number.
:return: list - current round and the two that follow.
@@ -9,7 +9,7 @@ def get_rounds(number):
def concatenate_rounds(rounds_1, rounds_2):
"""Concatenate a list of round numbers with the other, joining them into one bigger list.
"""Concatenates two lists of round numbers.
:param rounds_1: list - first rounds played.
:param rounds_2: list - second set of rounds played.
@@ -20,7 +20,7 @@ def concatenate_rounds(rounds_1, rounds_2):
def list_contains_round(rounds, number):
"""Check if the list of rounds contains the specified number.
"""Checks if the list of rounds contains the specified number.
:param rounds: list - rounds played.
:param number: int - round number.
@@ -31,7 +31,7 @@ def list_contains_round(rounds, number):
def card_average(hand):
"""Get the average of the list of card values.
"""Calculates and returns the average card value from the list.
:param hand: list - cards in hand.
:return: float - average value of the cards in the hand.
@@ -41,7 +41,7 @@ def card_average(hand):
def approx_average_is_average(hand):
"""Get the average of the list of card values using either the first and last index values, or the 'middle' card.
"""Returns if an average using (first + last index values ) OR ('middle' card) == calculated average.
:param hand: list - cards in hand.
:return: bool - if approximate average equals to the `true average`.
@@ -58,7 +58,7 @@ def approx_average_is_average(hand):
def average_even_is_average_odd(hand):
"""Check if the even indexed card values and odd indexed card values share the same average.
"""Returns if the (average of even indexed card values) == (average of odd indexed card values).
:param hand: list - cards in hand.
:return: bool - are even and odd averages equal?
@@ -68,7 +68,7 @@ def average_even_is_average_odd(hand):
def maybe_double_last(hand):
"""Check if the hand has a Jack at its last index -- if so, its value is multiplied by two.
"""Multiplies a Jack card value in the last index position by 2.
:param hand: list - cards in hand.
:return: list - hand with Jacks (if present) value doubled.