From 78daac1dbf0fd5b0e98403354672a3b4b7c33232 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Fri, 8 May 2026 19:57:23 -0700 Subject: [PATCH 1/3] Updated stub docstrings to match google style. --- .../list_methods.py | 65 ++++++++++++------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/exercises/concept/chaitanas-colossal-coaster/list_methods.py b/exercises/concept/chaitanas-colossal-coaster/list_methods.py index 6603b5adf67..5a83088e3aa 100644 --- a/exercises/concept/chaitanas-colossal-coaster/list_methods.py +++ b/exercises/concept/chaitanas-colossal-coaster/list_methods.py @@ -4,11 +4,14 @@ def add_me_to_the_queue(express_queue, normal_queue, ticket_type, person_name): """Add a person to the 'express' or 'normal' queue depending on the ticket number. - :param express_queue: list - names in the Fast-track queue. - :param normal_queue: list - names in the normal queue. - :param ticket_type: int - type of ticket. 1 = express, 0 = normal. - :param person_name: str - name of person to add to a queue. - :return: list - the (updated) queue the name was added to. + Parameters: + express_queue (list): The names in the Fast-track queue. + normal_queue (list): The names in the normal queue. + ticket_type (int): Type of ticket. 1 = express, 0 = normal. + person_name (str): The name of person to add to a queue. + + Returns: + list: The (updated) queue the name was added to. """ pass @@ -17,9 +20,12 @@ def add_me_to_the_queue(express_queue, normal_queue, ticket_type, person_name): def find_my_friend(queue, friend_name): """Search the queue for a name and return their queue position (index). - :param queue: list - names in the queue. - :param friend_name: str - name of friend to find. - :return: int - index at which the friends name was found. + Parameters: + queue (list): The names in the queue. + friend_name (str): The name of friend to find. + + Returns: + int: The index at which the friends name was found. """ pass @@ -28,10 +34,13 @@ def find_my_friend(queue, friend_name): def add_me_with_my_friends(queue, index, person_name): """Insert the late arrival's name at a specific index of the queue. - :param queue: list - names in the queue. - :param index: int - the index at which to add the new name. - :param person_name: str - the name to add. - :return: list - queue updated with new name. + Parameters: + queue (list): The names in the queue. + index (int): The index at which to add the new name. + person_name (str): The name to add. + + Returns: + list: The queue updated with new name. """ pass @@ -40,9 +49,12 @@ def add_me_with_my_friends(queue, index, person_name): def remove_the_mean_person(queue, person_name): """Remove the mean person from the queue by the provided name. - :param queue: list - names in the queue. - :param person_name: str - name of mean person. - :return: list - queue update with the mean persons name removed. + Parameters: + queue (list): The names in the queue. + person_name (str): The name of mean person. + + Returns: + list: The queue updated with the mean persons name removed. """ pass @@ -51,9 +63,12 @@ def remove_the_mean_person(queue, person_name): def how_many_namefellows(queue, person_name): """Count how many times the provided name appears in the queue. - :param queue: list - names in the queue. - :param person_name: str - name you wish to count or track. - :return: int - the number of times the name appears in the queue. + Parameters: + queue (list): The names in the queue. + person_name (str): The name you wish to count or track. + + Returns: + int: The number of times the name appears in the queue. """ pass @@ -62,8 +77,11 @@ def how_many_namefellows(queue, person_name): def remove_the_last_person(queue): """Remove the person in the last index from the queue and return their name. - :param queue: list - names in the queue. - :return: str - name that has been removed from the end of the queue. + Parameters: + queue (list): The names in the queue. + + Returns: + str: The name that has been removed from the end of the queue. """ pass @@ -72,8 +90,11 @@ def remove_the_last_person(queue): def sorted_names(queue): """Sort the names in the queue in alphabetical order and return the result. - :param queue: list - names in the queue. - :return: list - copy of the queue in alphabetical order. + Parameters: + queue (list): The names in the queue. + + Returns: + list: A copy of the queue in alphabetical order. """ pass From 6e0a585de28ae68447722bd55c823baa786d07fe Mon Sep 17 00:00:00 2001 From: BethanyG Date: Sat, 9 May 2026 10:36:12 -0700 Subject: [PATCH 2/3] Reformatted docstrings in stub to align with Google Style guide. --- .../concept/currency-exchange/exchange.py | 136 ++++++++++++++---- 1 file changed, 110 insertions(+), 26 deletions(-) diff --git a/exercises/concept/currency-exchange/exchange.py b/exercises/concept/currency-exchange/exchange.py index b58df5cbe48..36d972f7987 100644 --- a/exercises/concept/currency-exchange/exchange.py +++ b/exercises/concept/currency-exchange/exchange.py @@ -8,68 +8,152 @@ def exchange_money(budget, exchange_rate): - """ + """Calculate estimated value after exchange. + + Parameters: + budget (float): Tthe amount of money you are planning to exchange. + exchange_rate (float): The unit value of the foreign currency. + + Returns: + float: The exchanged value of the foreign currency you can receive. + + Examples: + >>> exchange_money(127.5, 1.2) + 106.25 + + >>> exchange_money(200, 1.10) + 181.82 + + This function calculates and returns the (estimated) value of the exchanged currency. - :param budget: float - amount of money you are planning to exchange. - :param exchange_rate: float - unit value of the foreign currency. - :return: float - exchanged value of the foreign currency you can receive. """ pass def get_change(budget, exchanging_value): - """ + """Calculate currency left after an exchange. + + Parameters: + budget (float): The amount of money you own. + exchanging_value (float): The amount of your money you want to exchange now. + + Returns: + float: The amount left of your starting currency after the exchange + + Examples: + .>>> get_change(127.5, 120.0) + 7.5 + + >>> get_change(300.75, 150.25) + 150.50 + + Tthis function calcultes and returns the amount of money left over from the budget + after an exchange. - :param budget: float - amount of money you own. - :param exchanging_value: float - amount of your money you want to exchange now. - :return: float - amount left of your starting currency after exchanging. """ pass def get_value_of_bills(denomination, number_of_bills): - """ + """Calculate the total value of currency at current denomination. + + Parameters: + denomination (int): The value of a single unit (bill). + number_of_bills (int): The total number of units (bills). + + Returns: + int: Calculated value of the units (bills). + + Examples: + >>> get_value_of_bills(5, 128) + 640 + + >>> get_value_of_bills(15.13, 16) + 242 + + This function calculates and returns the total value of the bills (excluding fractionaal amounts). - :param denomination: int - the value of a bill. - :param number_of_bills: int - total number of bills. - :return: int - calculated value of the bills. """ pass def get_number_of_bills(amount, denomination): - """ + """Calculate the number of currency units (bills) within the amount. + + Parameters: + amount (float): The total starting value. + denomination (int): The value of a single unit (bill). + + Returns: + int: The number of units (bills) that can be obtained from the amount. + + Examples: + >>> get_number_of_bills(127.5, 5) + 25 + + >>> get_number_of_bills(35.16, 10) + 3 + + This function calcluates and returns the number pf currency units (bills) that can + be obtained from the given amount. Whole bills only - no fractioal amounts. - :param amount: float - the total starting value. - :param denomination: int - the value of a single bill. - :return: int - number of bills that can be obtained from the amount. """ pass def get_leftover_of_bills(amount, denomination): - """ + """Calculate leftover amount after exchanging into bills. + + Parameters: + amount (float): The total starting value. + denomination (int): The value of a single unit (bill). + + Returns: + float: The amount that is "leftover", given the current denomination. + + Examples: + >>> get_leftover_of_bills(127.5, 20) + 7.5 + + >>> get_leftover_of_bills(153.2, 10) + 3.20 + + This function calculates and returns the leftover amount that cannot be + returned from starting amount, due to the currency denomination. - :param amount: float - the total starting value. - :param denomination: int - the value of a single bill. - :return: float - the amount that is "leftover", given the current denomination. """ pass def exchangeable_value(budget, exchange_rate, spread, denomination): - """ + """Calculate the maximum value of the new currency. + + Parameters: + budget (float): The amount of your money you are planning to exchange. + exchange_rate (float): The unit value of the foreign currency. + spread (int): The percentage that is taken as an exchange fee. + denomination (int) The value of a single unit (bill). + + Returns: + int: The maximum value you can get in the new currency. + + Examples: + >>> exchangeable_value(127.25, 1.20, 10, 20) + 80 + + >>> exchangeable_value(127.25, 1.20, 10, 5) + 95 + + Note: + The currency denomination is a whole number and cannot be sub-divided. - :param budget: float - the amount of your money you are planning to exchange. - :param exchange_rate: float - the unit value of the foreign currency. - :param spread: int - percentage that is taken as an exchange fee. - :param denomination: int - the value of a single bill. - :return: int - maximum value you can get. + This function calculates and returns the maximum value of the new currency after + determining the exchange rate plus the spread. """ pass From 3e681b7efda770770dc546f3bd50e47bdd948037 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Sat, 9 May 2026 10:42:15 -0700 Subject: [PATCH 3/3] Reverting change to currency exchange since this is a different exercise. --- .../concept/currency-exchange/exchange.py | 136 ++++-------------- 1 file changed, 26 insertions(+), 110 deletions(-) diff --git a/exercises/concept/currency-exchange/exchange.py b/exercises/concept/currency-exchange/exchange.py index 36d972f7987..b58df5cbe48 100644 --- a/exercises/concept/currency-exchange/exchange.py +++ b/exercises/concept/currency-exchange/exchange.py @@ -8,152 +8,68 @@ def exchange_money(budget, exchange_rate): - """Calculate estimated value after exchange. - - Parameters: - budget (float): Tthe amount of money you are planning to exchange. - exchange_rate (float): The unit value of the foreign currency. - - Returns: - float: The exchanged value of the foreign currency you can receive. - - Examples: - >>> exchange_money(127.5, 1.2) - 106.25 - - >>> exchange_money(200, 1.10) - 181.82 - - This function calculates and returns the (estimated) value of the exchanged currency. + """ + :param budget: float - amount of money you are planning to exchange. + :param exchange_rate: float - unit value of the foreign currency. + :return: float - exchanged value of the foreign currency you can receive. """ pass def get_change(budget, exchanging_value): - """Calculate currency left after an exchange. - - Parameters: - budget (float): The amount of money you own. - exchanging_value (float): The amount of your money you want to exchange now. - - Returns: - float: The amount left of your starting currency after the exchange - - Examples: - .>>> get_change(127.5, 120.0) - 7.5 - - >>> get_change(300.75, 150.25) - 150.50 - - Tthis function calcultes and returns the amount of money left over from the budget - after an exchange. + """ + :param budget: float - amount of money you own. + :param exchanging_value: float - amount of your money you want to exchange now. + :return: float - amount left of your starting currency after exchanging. """ pass def get_value_of_bills(denomination, number_of_bills): - """Calculate the total value of currency at current denomination. - - Parameters: - denomination (int): The value of a single unit (bill). - number_of_bills (int): The total number of units (bills). - - Returns: - int: Calculated value of the units (bills). - - Examples: - >>> get_value_of_bills(5, 128) - 640 - - >>> get_value_of_bills(15.13, 16) - 242 - - This function calculates and returns the total value of the bills (excluding fractionaal amounts). + """ + :param denomination: int - the value of a bill. + :param number_of_bills: int - total number of bills. + :return: int - calculated value of the bills. """ pass def get_number_of_bills(amount, denomination): - """Calculate the number of currency units (bills) within the amount. - - Parameters: - amount (float): The total starting value. - denomination (int): The value of a single unit (bill). - - Returns: - int: The number of units (bills) that can be obtained from the amount. - - Examples: - >>> get_number_of_bills(127.5, 5) - 25 - - >>> get_number_of_bills(35.16, 10) - 3 - - This function calcluates and returns the number pf currency units (bills) that can - be obtained from the given amount. Whole bills only - no fractioal amounts. + """ + :param amount: float - the total starting value. + :param denomination: int - the value of a single bill. + :return: int - number of bills that can be obtained from the amount. """ pass def get_leftover_of_bills(amount, denomination): - """Calculate leftover amount after exchanging into bills. - - Parameters: - amount (float): The total starting value. - denomination (int): The value of a single unit (bill). - - Returns: - float: The amount that is "leftover", given the current denomination. - - Examples: - >>> get_leftover_of_bills(127.5, 20) - 7.5 - - >>> get_leftover_of_bills(153.2, 10) - 3.20 - - This function calculates and returns the leftover amount that cannot be - returned from starting amount, due to the currency denomination. + """ + :param amount: float - the total starting value. + :param denomination: int - the value of a single bill. + :return: float - the amount that is "leftover", given the current denomination. """ pass def exchangeable_value(budget, exchange_rate, spread, denomination): - """Calculate the maximum value of the new currency. - - Parameters: - budget (float): The amount of your money you are planning to exchange. - exchange_rate (float): The unit value of the foreign currency. - spread (int): The percentage that is taken as an exchange fee. - denomination (int) The value of a single unit (bill). - - Returns: - int: The maximum value you can get in the new currency. - - Examples: - >>> exchangeable_value(127.25, 1.20, 10, 20) - 80 - - >>> exchangeable_value(127.25, 1.20, 10, 5) - 95 - - Note: - The currency denomination is a whole number and cannot be sub-divided. + """ - This function calculates and returns the maximum value of the new currency after - determining the exchange rate plus the spread. + :param budget: float - the amount of your money you are planning to exchange. + :param exchange_rate: float - the unit value of the foreign currency. + :param spread: int - percentage that is taken as an exchange fee. + :param denomination: int - the value of a single bill. + :return: int - maximum value you can get. """ pass