From e73f141c2c45aff122a205b1563b93e769135ffa Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 02:39:37 -0800 Subject: [PATCH 001/107] Update index.rst --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 20687a2cf26..04a46ebf6c2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,7 +16,7 @@ Welcome to Python3 solutions for codewars problems documentation! kyu_4/kyu_4 kyu_5/kyu_5 kyu_6/kyu_6 - kyu_7 + kyu_7/kyu_7 kyu_8 utils From d76f7e6401df4668b9f035392cba2189842f6ff0 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 02:42:02 -0800 Subject: [PATCH 002/107] docs for kyu_7 --- docs/{ => kyu_7}/kyu_7.always_perfect.rst | 0 docs/{ => kyu_7}/kyu_7.basic_math_add_or_subtract.rst | 0 docs/{ => kyu_7}/kyu_7.beginner_series_sum_of_numbers.rst | 0 docs/{ => kyu_7}/kyu_7.coloured_triangles.module.rst | 0 docs/{ => kyu_7}/kyu_7.coloured_triangles.readme.rst | 0 docs/{ => kyu_7}/kyu_7.coloured_triangles.rst | 0 docs/{ => kyu_7}/kyu_7.disemvowel_trolls.rst | 0 docs/{ => kyu_7}/kyu_7.easy_line.rst | 0 docs/{ => kyu_7}/kyu_7.factorial.rst | 0 docs/{ => kyu_7}/kyu_7.fill_the_hard_disk_drive.rst | 0 docs/{ => kyu_7}/kyu_7.find_the_longest_gap.rst | 0 docs/{ => kyu_7}/kyu_7.formatting_decimal_places_1.rst | 0 docs/{ => kyu_7}/kyu_7.fun_with_lists_length.rst | 0 docs/{ => kyu_7}/kyu_7.growing_plant.rst | 0 docs/{ => kyu_7}/kyu_7.help_bob_count_letters_and_digits.rst | 0 docs/{ => kyu_7}/kyu_7.isograms.rst | 0 docs/{ => kyu_7}/kyu_7.jaden_casing_strings.rst | 0 docs/{ => kyu_7}/kyu_7.make_class.rst | 0 docs/{ => kyu_7}/kyu_7.maximum_multiple.rst | 0 docs/{ => kyu_7}/kyu_7.password_validator.rst | 0 docs/{ => kyu_7}/kyu_7.powers_of_3.rst | 0 docs/{ => kyu_7}/kyu_7.pull_your_words_together_man.rst | 0 docs/{ => kyu_7}/kyu_7.readme.rst | 0 docs/{ => kyu_7}/kyu_7.remove_the_minimum.rst | 0 docs/{ => kyu_7}/kyu_7.rst | 0 docs/{ => kyu_7}/kyu_7.share_prices.rst | 0 docs/{ => kyu_7}/kyu_7.significant_figures.rst | 0 docs/{ => kyu_7}/kyu_7.simple_fun_152.rst | 0 docs/{ => kyu_7}/kyu_7.sort_out_the_men_from_boys.rst | 0 .../kyu_7.substituting_variables_into_strings_padded_numbers.rst | 0 docs/{ => kyu_7}/kyu_7.sum_of_odd_numbers.rst | 0 docs/{ => kyu_7}/kyu_7.sum_of_powers_of_2.rst | 0 docs/{ => kyu_7}/kyu_7.sum_of_triangular_numbers.rst | 0 docs/{ => kyu_7}/kyu_7.sum_of_two_lowest_int.rst | 0 .../kyu_7.the_first_non_repeated_character_in_string.rst | 0 docs/{ => kyu_7}/kyu_7.valid_parentheses.rst | 0 docs/{ => kyu_7}/kyu_7.vaporcode.rst | 0 docs/{ => kyu_7}/kyu_7.you_are_square.rst | 0 38 files changed, 0 insertions(+), 0 deletions(-) rename docs/{ => kyu_7}/kyu_7.always_perfect.rst (100%) rename docs/{ => kyu_7}/kyu_7.basic_math_add_or_subtract.rst (100%) rename docs/{ => kyu_7}/kyu_7.beginner_series_sum_of_numbers.rst (100%) rename docs/{ => kyu_7}/kyu_7.coloured_triangles.module.rst (100%) rename docs/{ => kyu_7}/kyu_7.coloured_triangles.readme.rst (100%) rename docs/{ => kyu_7}/kyu_7.coloured_triangles.rst (100%) rename docs/{ => kyu_7}/kyu_7.disemvowel_trolls.rst (100%) rename docs/{ => kyu_7}/kyu_7.easy_line.rst (100%) rename docs/{ => kyu_7}/kyu_7.factorial.rst (100%) rename docs/{ => kyu_7}/kyu_7.fill_the_hard_disk_drive.rst (100%) rename docs/{ => kyu_7}/kyu_7.find_the_longest_gap.rst (100%) rename docs/{ => kyu_7}/kyu_7.formatting_decimal_places_1.rst (100%) rename docs/{ => kyu_7}/kyu_7.fun_with_lists_length.rst (100%) rename docs/{ => kyu_7}/kyu_7.growing_plant.rst (100%) rename docs/{ => kyu_7}/kyu_7.help_bob_count_letters_and_digits.rst (100%) rename docs/{ => kyu_7}/kyu_7.isograms.rst (100%) rename docs/{ => kyu_7}/kyu_7.jaden_casing_strings.rst (100%) rename docs/{ => kyu_7}/kyu_7.make_class.rst (100%) rename docs/{ => kyu_7}/kyu_7.maximum_multiple.rst (100%) rename docs/{ => kyu_7}/kyu_7.password_validator.rst (100%) rename docs/{ => kyu_7}/kyu_7.powers_of_3.rst (100%) rename docs/{ => kyu_7}/kyu_7.pull_your_words_together_man.rst (100%) rename docs/{ => kyu_7}/kyu_7.readme.rst (100%) rename docs/{ => kyu_7}/kyu_7.remove_the_minimum.rst (100%) rename docs/{ => kyu_7}/kyu_7.rst (100%) rename docs/{ => kyu_7}/kyu_7.share_prices.rst (100%) rename docs/{ => kyu_7}/kyu_7.significant_figures.rst (100%) rename docs/{ => kyu_7}/kyu_7.simple_fun_152.rst (100%) rename docs/{ => kyu_7}/kyu_7.sort_out_the_men_from_boys.rst (100%) rename docs/{ => kyu_7}/kyu_7.substituting_variables_into_strings_padded_numbers.rst (100%) rename docs/{ => kyu_7}/kyu_7.sum_of_odd_numbers.rst (100%) rename docs/{ => kyu_7}/kyu_7.sum_of_powers_of_2.rst (100%) rename docs/{ => kyu_7}/kyu_7.sum_of_triangular_numbers.rst (100%) rename docs/{ => kyu_7}/kyu_7.sum_of_two_lowest_int.rst (100%) rename docs/{ => kyu_7}/kyu_7.the_first_non_repeated_character_in_string.rst (100%) rename docs/{ => kyu_7}/kyu_7.valid_parentheses.rst (100%) rename docs/{ => kyu_7}/kyu_7.vaporcode.rst (100%) rename docs/{ => kyu_7}/kyu_7.you_are_square.rst (100%) diff --git a/docs/kyu_7.always_perfect.rst b/docs/kyu_7/kyu_7.always_perfect.rst similarity index 100% rename from docs/kyu_7.always_perfect.rst rename to docs/kyu_7/kyu_7.always_perfect.rst diff --git a/docs/kyu_7.basic_math_add_or_subtract.rst b/docs/kyu_7/kyu_7.basic_math_add_or_subtract.rst similarity index 100% rename from docs/kyu_7.basic_math_add_or_subtract.rst rename to docs/kyu_7/kyu_7.basic_math_add_or_subtract.rst diff --git a/docs/kyu_7.beginner_series_sum_of_numbers.rst b/docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.rst similarity index 100% rename from docs/kyu_7.beginner_series_sum_of_numbers.rst rename to docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.rst diff --git a/docs/kyu_7.coloured_triangles.module.rst b/docs/kyu_7/kyu_7.coloured_triangles.module.rst similarity index 100% rename from docs/kyu_7.coloured_triangles.module.rst rename to docs/kyu_7/kyu_7.coloured_triangles.module.rst diff --git a/docs/kyu_7.coloured_triangles.readme.rst b/docs/kyu_7/kyu_7.coloured_triangles.readme.rst similarity index 100% rename from docs/kyu_7.coloured_triangles.readme.rst rename to docs/kyu_7/kyu_7.coloured_triangles.readme.rst diff --git a/docs/kyu_7.coloured_triangles.rst b/docs/kyu_7/kyu_7.coloured_triangles.rst similarity index 100% rename from docs/kyu_7.coloured_triangles.rst rename to docs/kyu_7/kyu_7.coloured_triangles.rst diff --git a/docs/kyu_7.disemvowel_trolls.rst b/docs/kyu_7/kyu_7.disemvowel_trolls.rst similarity index 100% rename from docs/kyu_7.disemvowel_trolls.rst rename to docs/kyu_7/kyu_7.disemvowel_trolls.rst diff --git a/docs/kyu_7.easy_line.rst b/docs/kyu_7/kyu_7.easy_line.rst similarity index 100% rename from docs/kyu_7.easy_line.rst rename to docs/kyu_7/kyu_7.easy_line.rst diff --git a/docs/kyu_7.factorial.rst b/docs/kyu_7/kyu_7.factorial.rst similarity index 100% rename from docs/kyu_7.factorial.rst rename to docs/kyu_7/kyu_7.factorial.rst diff --git a/docs/kyu_7.fill_the_hard_disk_drive.rst b/docs/kyu_7/kyu_7.fill_the_hard_disk_drive.rst similarity index 100% rename from docs/kyu_7.fill_the_hard_disk_drive.rst rename to docs/kyu_7/kyu_7.fill_the_hard_disk_drive.rst diff --git a/docs/kyu_7.find_the_longest_gap.rst b/docs/kyu_7/kyu_7.find_the_longest_gap.rst similarity index 100% rename from docs/kyu_7.find_the_longest_gap.rst rename to docs/kyu_7/kyu_7.find_the_longest_gap.rst diff --git a/docs/kyu_7.formatting_decimal_places_1.rst b/docs/kyu_7/kyu_7.formatting_decimal_places_1.rst similarity index 100% rename from docs/kyu_7.formatting_decimal_places_1.rst rename to docs/kyu_7/kyu_7.formatting_decimal_places_1.rst diff --git a/docs/kyu_7.fun_with_lists_length.rst b/docs/kyu_7/kyu_7.fun_with_lists_length.rst similarity index 100% rename from docs/kyu_7.fun_with_lists_length.rst rename to docs/kyu_7/kyu_7.fun_with_lists_length.rst diff --git a/docs/kyu_7.growing_plant.rst b/docs/kyu_7/kyu_7.growing_plant.rst similarity index 100% rename from docs/kyu_7.growing_plant.rst rename to docs/kyu_7/kyu_7.growing_plant.rst diff --git a/docs/kyu_7.help_bob_count_letters_and_digits.rst b/docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.rst similarity index 100% rename from docs/kyu_7.help_bob_count_letters_and_digits.rst rename to docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.rst diff --git a/docs/kyu_7.isograms.rst b/docs/kyu_7/kyu_7.isograms.rst similarity index 100% rename from docs/kyu_7.isograms.rst rename to docs/kyu_7/kyu_7.isograms.rst diff --git a/docs/kyu_7.jaden_casing_strings.rst b/docs/kyu_7/kyu_7.jaden_casing_strings.rst similarity index 100% rename from docs/kyu_7.jaden_casing_strings.rst rename to docs/kyu_7/kyu_7.jaden_casing_strings.rst diff --git a/docs/kyu_7.make_class.rst b/docs/kyu_7/kyu_7.make_class.rst similarity index 100% rename from docs/kyu_7.make_class.rst rename to docs/kyu_7/kyu_7.make_class.rst diff --git a/docs/kyu_7.maximum_multiple.rst b/docs/kyu_7/kyu_7.maximum_multiple.rst similarity index 100% rename from docs/kyu_7.maximum_multiple.rst rename to docs/kyu_7/kyu_7.maximum_multiple.rst diff --git a/docs/kyu_7.password_validator.rst b/docs/kyu_7/kyu_7.password_validator.rst similarity index 100% rename from docs/kyu_7.password_validator.rst rename to docs/kyu_7/kyu_7.password_validator.rst diff --git a/docs/kyu_7.powers_of_3.rst b/docs/kyu_7/kyu_7.powers_of_3.rst similarity index 100% rename from docs/kyu_7.powers_of_3.rst rename to docs/kyu_7/kyu_7.powers_of_3.rst diff --git a/docs/kyu_7.pull_your_words_together_man.rst b/docs/kyu_7/kyu_7.pull_your_words_together_man.rst similarity index 100% rename from docs/kyu_7.pull_your_words_together_man.rst rename to docs/kyu_7/kyu_7.pull_your_words_together_man.rst diff --git a/docs/kyu_7.readme.rst b/docs/kyu_7/kyu_7.readme.rst similarity index 100% rename from docs/kyu_7.readme.rst rename to docs/kyu_7/kyu_7.readme.rst diff --git a/docs/kyu_7.remove_the_minimum.rst b/docs/kyu_7/kyu_7.remove_the_minimum.rst similarity index 100% rename from docs/kyu_7.remove_the_minimum.rst rename to docs/kyu_7/kyu_7.remove_the_minimum.rst diff --git a/docs/kyu_7.rst b/docs/kyu_7/kyu_7.rst similarity index 100% rename from docs/kyu_7.rst rename to docs/kyu_7/kyu_7.rst diff --git a/docs/kyu_7.share_prices.rst b/docs/kyu_7/kyu_7.share_prices.rst similarity index 100% rename from docs/kyu_7.share_prices.rst rename to docs/kyu_7/kyu_7.share_prices.rst diff --git a/docs/kyu_7.significant_figures.rst b/docs/kyu_7/kyu_7.significant_figures.rst similarity index 100% rename from docs/kyu_7.significant_figures.rst rename to docs/kyu_7/kyu_7.significant_figures.rst diff --git a/docs/kyu_7.simple_fun_152.rst b/docs/kyu_7/kyu_7.simple_fun_152.rst similarity index 100% rename from docs/kyu_7.simple_fun_152.rst rename to docs/kyu_7/kyu_7.simple_fun_152.rst diff --git a/docs/kyu_7.sort_out_the_men_from_boys.rst b/docs/kyu_7/kyu_7.sort_out_the_men_from_boys.rst similarity index 100% rename from docs/kyu_7.sort_out_the_men_from_boys.rst rename to docs/kyu_7/kyu_7.sort_out_the_men_from_boys.rst diff --git a/docs/kyu_7.substituting_variables_into_strings_padded_numbers.rst b/docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.rst similarity index 100% rename from docs/kyu_7.substituting_variables_into_strings_padded_numbers.rst rename to docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.rst diff --git a/docs/kyu_7.sum_of_odd_numbers.rst b/docs/kyu_7/kyu_7.sum_of_odd_numbers.rst similarity index 100% rename from docs/kyu_7.sum_of_odd_numbers.rst rename to docs/kyu_7/kyu_7.sum_of_odd_numbers.rst diff --git a/docs/kyu_7.sum_of_powers_of_2.rst b/docs/kyu_7/kyu_7.sum_of_powers_of_2.rst similarity index 100% rename from docs/kyu_7.sum_of_powers_of_2.rst rename to docs/kyu_7/kyu_7.sum_of_powers_of_2.rst diff --git a/docs/kyu_7.sum_of_triangular_numbers.rst b/docs/kyu_7/kyu_7.sum_of_triangular_numbers.rst similarity index 100% rename from docs/kyu_7.sum_of_triangular_numbers.rst rename to docs/kyu_7/kyu_7.sum_of_triangular_numbers.rst diff --git a/docs/kyu_7.sum_of_two_lowest_int.rst b/docs/kyu_7/kyu_7.sum_of_two_lowest_int.rst similarity index 100% rename from docs/kyu_7.sum_of_two_lowest_int.rst rename to docs/kyu_7/kyu_7.sum_of_two_lowest_int.rst diff --git a/docs/kyu_7.the_first_non_repeated_character_in_string.rst b/docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.rst similarity index 100% rename from docs/kyu_7.the_first_non_repeated_character_in_string.rst rename to docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.rst diff --git a/docs/kyu_7.valid_parentheses.rst b/docs/kyu_7/kyu_7.valid_parentheses.rst similarity index 100% rename from docs/kyu_7.valid_parentheses.rst rename to docs/kyu_7/kyu_7.valid_parentheses.rst diff --git a/docs/kyu_7.vaporcode.rst b/docs/kyu_7/kyu_7.vaporcode.rst similarity index 100% rename from docs/kyu_7.vaporcode.rst rename to docs/kyu_7/kyu_7.vaporcode.rst diff --git a/docs/kyu_7.you_are_square.rst b/docs/kyu_7/kyu_7.you_are_square.rst similarity index 100% rename from docs/kyu_7.you_are_square.rst rename to docs/kyu_7/kyu_7.you_are_square.rst From 14f6edbab935e58f186b1ba577d00b55b1162e1e Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 02:43:09 -0800 Subject: [PATCH 003/107] Update kyu_7.readme.rst --- docs/kyu_7/kyu_7.readme.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kyu_7/kyu_7.readme.rst b/docs/kyu_7/kyu_7.readme.rst index e6a2be179f9..73bd6f4cfe6 100644 --- a/docs/kyu_7/kyu_7.readme.rst +++ b/docs/kyu_7/kyu_7.readme.rst @@ -1,5 +1,5 @@ README ====== -.. include:: ../kyu_7/README.md +.. include:: ../../kyu_7/README.md :parser: myst_parser.sphinx_ \ No newline at end of file From 73a9233a837d7ca7754cf8be9d7eefa27b9c10aa Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 02:47:12 -0800 Subject: [PATCH 004/107] always_perfect --- docs/kyu_7/kyu_7.always_perfect.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.always_perfect.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.always_perfect.module.rst create mode 100644 docs/kyu_7/kyu_7.always_perfect.readme.rst diff --git a/docs/kyu_7/kyu_7.always_perfect.module.rst b/docs/kyu_7/kyu_7.always_perfect.module.rst new file mode 100644 index 00000000000..bb662a161ec --- /dev/null +++ b/docs/kyu_7/kyu_7.always_perfect.module.rst @@ -0,0 +1,11 @@ +kyu\_7.always\_perfect.module package +===================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.always_perfect.readme + kyu_7. \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.always_perfect.readme.rst b/docs/kyu_7/kyu_7.always_perfect.readme.rst new file mode 100644 index 00000000000..7473f611894 --- /dev/null +++ b/docs/kyu_7/kyu_7.always_perfect.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/always_perfect/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index dbf31d06e07..b5a134b2388 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -8,7 +8,7 @@ Subpackages :maxdepth: 4 kyu_7.readme - kyu_7.always_perfect + kyu_7.always_perfect.module kyu_7.basic_math_add_or_subtract kyu_7.beginner_series_sum_of_numbers kyu_7.coloured_triangles.module From e1881f0edca1881a65ec867c8d4b65c9664331c1 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 02:58:24 -0800 Subject: [PATCH 005/107] Update kyu_7.always_perfect.module.rst --- docs/kyu_7/kyu_7.always_perfect.module.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kyu_7/kyu_7.always_perfect.module.rst b/docs/kyu_7/kyu_7.always_perfect.module.rst index bb662a161ec..14ade26407c 100644 --- a/docs/kyu_7/kyu_7.always_perfect.module.rst +++ b/docs/kyu_7/kyu_7.always_perfect.module.rst @@ -8,4 +8,4 @@ Subpackages :maxdepth: 4 kyu_7.always_perfect.readme - kyu_7. \ No newline at end of file + kyu_7.always_perfect \ No newline at end of file From 8fc0aa4e33d06971f7d3cb3be951525e8d6cb78b Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:01:15 -0800 Subject: [PATCH 006/107] Update kyu_7.coloured_triangles.readme.rst --- docs/kyu_7/kyu_7.coloured_triangles.readme.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kyu_7/kyu_7.coloured_triangles.readme.rst b/docs/kyu_7/kyu_7.coloured_triangles.readme.rst index 51ad2f4b725..61e996a48a3 100644 --- a/docs/kyu_7/kyu_7.coloured_triangles.readme.rst +++ b/docs/kyu_7/kyu_7.coloured_triangles.readme.rst @@ -1,5 +1,5 @@ README ====== -.. include:: ../kyu_7/coloured_triangles/README.md +.. include:: ../../kyu_7/coloured_triangles/README.md :parser: myst_parser.sphinx_ \ No newline at end of file From e5539c26435b88cd05d5ce179a8083223aa7d6fc Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:05:02 -0800 Subject: [PATCH 007/107] basic_math_add_or_subtract --- .../kyu_7/kyu_7.basic_math_add_or_subtract.module.rst | 11 +++++++++++ .../kyu_7/kyu_7.basic_math_add_or_subtract.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.basic_math_add_or_subtract.module.rst create mode 100644 docs/kyu_7/kyu_7.basic_math_add_or_subtract.readme.rst diff --git a/docs/kyu_7/kyu_7.basic_math_add_or_subtract.module.rst b/docs/kyu_7/kyu_7.basic_math_add_or_subtract.module.rst new file mode 100644 index 00000000000..cc522b5047c --- /dev/null +++ b/docs/kyu_7/kyu_7.basic_math_add_or_subtract.module.rst @@ -0,0 +1,11 @@ +kyu\_7.basic\_math\_add\_or\_subtract.module package +==================================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.basic_math_add_or_subtract.readme + kyu_7.basic_math_add_or_subtract \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.basic_math_add_or_subtract.readme.rst b/docs/kyu_7/kyu_7.basic_math_add_or_subtract.readme.rst new file mode 100644 index 00000000000..e183b4e1099 --- /dev/null +++ b/docs/kyu_7/kyu_7.basic_math_add_or_subtract.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/basic_math_add_or_subtract/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index b5a134b2388..cc9408cd43f 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -9,7 +9,7 @@ Subpackages kyu_7.readme kyu_7.always_perfect.module - kyu_7.basic_math_add_or_subtract + kyu_7.basic_math_add_or_subtract.module kyu_7.beginner_series_sum_of_numbers kyu_7.coloured_triangles.module kyu_7.disemvowel_trolls From c82ed6e7a043ee492f246edc85065fefe36f10bb Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:07:53 -0800 Subject: [PATCH 008/107] beginner_series_sum_of_numbers --- .../kyu_7.beginner_series_sum_of_numbers.module.rst | 11 +++++++++++ .../kyu_7.beginner_series_sum_of_numbers.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.module.rst create mode 100644 docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.readme.rst diff --git a/docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.module.rst b/docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.module.rst new file mode 100644 index 00000000000..87b2a9cf943 --- /dev/null +++ b/docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.module.rst @@ -0,0 +1,11 @@ +kyu\_7.beginner_series_sum_of_numbers.module package +==================================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.beginner_series_sum_of_numbers.readme + kyu_7.beginner_series_sum_of_numbers \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.readme.rst b/docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.readme.rst new file mode 100644 index 00000000000..68896caff58 --- /dev/null +++ b/docs/kyu_7/kyu_7.beginner_series_sum_of_numbers.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/beginner_series_sum_of_numbers/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index cc9408cd43f..268c2140cbd 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -10,9 +10,9 @@ Subpackages kyu_7.readme kyu_7.always_perfect.module kyu_7.basic_math_add_or_subtract.module - kyu_7.beginner_series_sum_of_numbers + kyu_7.beginner_series_sum_of_numbers.module kyu_7.coloured_triangles.module - kyu_7.disemvowel_trolls + kyu_7.disemvowel_trolls.module kyu_7.easy_line kyu_7.factorial kyu_7.fill_the_hard_disk_drive From d0434e89073900336317a0095a090add4a37d4f9 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:09:27 -0800 Subject: [PATCH 009/107] disemvowel_trolls --- docs/kyu_7/kyu_7.disemvowel_trolls.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.disemvowel_trolls.readme.rst | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 docs/kyu_7/kyu_7.disemvowel_trolls.module.rst create mode 100644 docs/kyu_7/kyu_7.disemvowel_trolls.readme.rst diff --git a/docs/kyu_7/kyu_7.disemvowel_trolls.module.rst b/docs/kyu_7/kyu_7.disemvowel_trolls.module.rst new file mode 100644 index 00000000000..64957dad5f1 --- /dev/null +++ b/docs/kyu_7/kyu_7.disemvowel_trolls.module.rst @@ -0,0 +1,11 @@ +kyu\_7.disemvowel_trolls.module package +======================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.disemvowel_trolls.readme + kyu_7.disemvowel_trolls \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.disemvowel_trolls.readme.rst b/docs/kyu_7/kyu_7.disemvowel_trolls.readme.rst new file mode 100644 index 00000000000..768938de9ce --- /dev/null +++ b/docs/kyu_7/kyu_7.disemvowel_trolls.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/disemvowel_trolls/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 4150a6e23c60ed09f1018c91e07d8a2fd5ca39c3 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:12:16 -0800 Subject: [PATCH 010/107] easy_line --- docs/kyu_7/kyu_7.easy_line.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.easy_line.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.easy_line.module.rst create mode 100644 docs/kyu_7/kyu_7.easy_line.readme.rst diff --git a/docs/kyu_7/kyu_7.easy_line.module.rst b/docs/kyu_7/kyu_7.easy_line.module.rst new file mode 100644 index 00000000000..78ad05bc7c4 --- /dev/null +++ b/docs/kyu_7/kyu_7.easy_line.module.rst @@ -0,0 +1,11 @@ +kyu\_7.easy\_line.module package +================================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.easy_line.readme + kyu_7.easy_line \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.easy_line.readme.rst b/docs/kyu_7/kyu_7.easy_line.readme.rst new file mode 100644 index 00000000000..4c7d6a199f5 --- /dev/null +++ b/docs/kyu_7/kyu_7.easy_line.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/easy_line/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 268c2140cbd..0d191d2099b 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -13,7 +13,7 @@ Subpackages kyu_7.beginner_series_sum_of_numbers.module kyu_7.coloured_triangles.module kyu_7.disemvowel_trolls.module - kyu_7.easy_line + kyu_7.easy_line.module kyu_7.factorial kyu_7.fill_the_hard_disk_drive kyu_7.find_the_longest_gap From cb888c37ab214b4936eaf9f7784b777307ac64ae Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:14:42 -0800 Subject: [PATCH 011/107] factorial --- docs/kyu_7/kyu_7.factorial.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.factorial.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.factorial.module.rst create mode 100644 docs/kyu_7/kyu_7.factorial.readme.rst diff --git a/docs/kyu_7/kyu_7.factorial.module.rst b/docs/kyu_7/kyu_7.factorial.module.rst new file mode 100644 index 00000000000..febe84062f1 --- /dev/null +++ b/docs/kyu_7/kyu_7.factorial.module.rst @@ -0,0 +1,11 @@ +kyu\_7.factorial.module package +=============================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.factorial.readme + kyu_7.factorial \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.factorial.readme.rst b/docs/kyu_7/kyu_7.factorial.readme.rst new file mode 100644 index 00000000000..745efc374c8 --- /dev/null +++ b/docs/kyu_7/kyu_7.factorial.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/factorial/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 0d191d2099b..2d5897b220a 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -14,7 +14,7 @@ Subpackages kyu_7.coloured_triangles.module kyu_7.disemvowel_trolls.module kyu_7.easy_line.module - kyu_7.factorial + kyu_7.factorial.module kyu_7.fill_the_hard_disk_drive kyu_7.find_the_longest_gap kyu_7.formatting_decimal_places_1 From f9afea51706077aed5ee308ed73698b44d712756 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:17:46 -0800 Subject: [PATCH 012/107] fill_the_hard_disk_drive --- docs/kyu_7/kyu_7.fill_the_hard_disk_drive.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.fill_the_hard_disk_drive.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.fill_the_hard_disk_drive.module.rst create mode 100644 docs/kyu_7/kyu_7.fill_the_hard_disk_drive.readme.rst diff --git a/docs/kyu_7/kyu_7.fill_the_hard_disk_drive.module.rst b/docs/kyu_7/kyu_7.fill_the_hard_disk_drive.module.rst new file mode 100644 index 00000000000..74f6bf1cf63 --- /dev/null +++ b/docs/kyu_7/kyu_7.fill_the_hard_disk_drive.module.rst @@ -0,0 +1,11 @@ +kyu\_7.fill_the_hard_disk_drive.module package +============================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.fill_the_hard_disk_drive.readme + kyu_7.fill_the_hard_disk_drive \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.fill_the_hard_disk_drive.readme.rst b/docs/kyu_7/kyu_7.fill_the_hard_disk_drive.readme.rst new file mode 100644 index 00000000000..927fd00e76e --- /dev/null +++ b/docs/kyu_7/kyu_7.fill_the_hard_disk_drive.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/fill_the_hard_disk_drive/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 2d5897b220a..4eafe590d4c 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -15,7 +15,7 @@ Subpackages kyu_7.disemvowel_trolls.module kyu_7.easy_line.module kyu_7.factorial.module - kyu_7.fill_the_hard_disk_drive + kyu_7.fill_the_hard_disk_drive.module kyu_7.find_the_longest_gap kyu_7.formatting_decimal_places_1 kyu_7.fun_with_lists_length From fa4b86184a5906098f26fe2c69023bd77520613a Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:21:33 -0800 Subject: [PATCH 013/107] find_the_longest_gap --- docs/kyu_7/kyu_7.find_the_longest_gap.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.find_the_longest_gap.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.find_the_longest_gap.module.rst create mode 100644 docs/kyu_7/kyu_7.find_the_longest_gap.readme.rst diff --git a/docs/kyu_7/kyu_7.find_the_longest_gap.module.rst b/docs/kyu_7/kyu_7.find_the_longest_gap.module.rst new file mode 100644 index 00000000000..585636c9897 --- /dev/null +++ b/docs/kyu_7/kyu_7.find_the_longest_gap.module.rst @@ -0,0 +1,11 @@ +kyu\_7.find\_the\_longest\_gap.module package +============================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.find_the_longest_gap.readme + kyu_7.find_the_longest_gap \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.find_the_longest_gap.readme.rst b/docs/kyu_7/kyu_7.find_the_longest_gap.readme.rst new file mode 100644 index 00000000000..c81a0a3520e --- /dev/null +++ b/docs/kyu_7/kyu_7.find_the_longest_gap.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/find_the_longest_gap/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 4eafe590d4c..7b1c05e8819 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -16,7 +16,7 @@ Subpackages kyu_7.easy_line.module kyu_7.factorial.module kyu_7.fill_the_hard_disk_drive.module - kyu_7.find_the_longest_gap + kyu_7.find_the_longest_gap.module kyu_7.formatting_decimal_places_1 kyu_7.fun_with_lists_length kyu_7.growing_plant From 698bf8e8e9b6911756f320fa88b0c853a74e9997 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:23:42 -0800 Subject: [PATCH 014/107] formatting_decimal_places_1 --- .../kyu_7.formatting_decimal_places_1.module.rst | 11 +++++++++++ .../kyu_7.formatting_decimal_places_1.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.formatting_decimal_places_1.module.rst create mode 100644 docs/kyu_7/kyu_7.formatting_decimal_places_1.readme.rst diff --git a/docs/kyu_7/kyu_7.formatting_decimal_places_1.module.rst b/docs/kyu_7/kyu_7.formatting_decimal_places_1.module.rst new file mode 100644 index 00000000000..56f1e9bbf68 --- /dev/null +++ b/docs/kyu_7/kyu_7.formatting_decimal_places_1.module.rst @@ -0,0 +1,11 @@ +kyu\_7.formatting\_decimal\_places\_1.module package +==================================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.formatting_decimal_places_1.readme + kyu_7.formatting_decimal_places_1 \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.formatting_decimal_places_1.readme.rst b/docs/kyu_7/kyu_7.formatting_decimal_places_1.readme.rst new file mode 100644 index 00000000000..90babf3b3a8 --- /dev/null +++ b/docs/kyu_7/kyu_7.formatting_decimal_places_1.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/formatting_decimal_places_1/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 7b1c05e8819..17a8361861a 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -17,7 +17,7 @@ Subpackages kyu_7.factorial.module kyu_7.fill_the_hard_disk_drive.module kyu_7.find_the_longest_gap.module - kyu_7.formatting_decimal_places_1 + kyu_7.formatting_decimal_places_1.module kyu_7.fun_with_lists_length kyu_7.growing_plant kyu_7.help_bob_count_letters_and_digits From 787b34ca442922b8984da427b7741ba9ad769319 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:27:25 -0800 Subject: [PATCH 015/107] fun_with_lists_length --- docs/kyu_7/kyu_7.fun_with_lists_length.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.fun_with_lists_length.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.fun_with_lists_length.module.rst create mode 100644 docs/kyu_7/kyu_7.fun_with_lists_length.readme.rst diff --git a/docs/kyu_7/kyu_7.fun_with_lists_length.module.rst b/docs/kyu_7/kyu_7.fun_with_lists_length.module.rst new file mode 100644 index 00000000000..19224981918 --- /dev/null +++ b/docs/kyu_7/kyu_7.fun_with_lists_length.module.rst @@ -0,0 +1,11 @@ +kyu\_7.fun\_with\_lists\_length.module package +============================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.fun_with_lists_length.readme + kyu_7.fun_with_lists_length \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.fun_with_lists_length.readme.rst b/docs/kyu_7/kyu_7.fun_with_lists_length.readme.rst new file mode 100644 index 00000000000..98a23e0a118 --- /dev/null +++ b/docs/kyu_7/kyu_7.fun_with_lists_length.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/fun_with_lists_length/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 17a8361861a..6d22f6da757 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -18,7 +18,7 @@ Subpackages kyu_7.fill_the_hard_disk_drive.module kyu_7.find_the_longest_gap.module kyu_7.formatting_decimal_places_1.module - kyu_7.fun_with_lists_length + kyu_7.fun_with_lists_length.module kyu_7.growing_plant kyu_7.help_bob_count_letters_and_digits kyu_7.isograms From 3363fc9c927ff266e2e340f27bb5128a49d7b01b Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:29:42 -0800 Subject: [PATCH 016/107] growing_plant --- docs/kyu_7/kyu_7.growing_plant.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.growing_plant.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.growing_plant.module.rst create mode 100644 docs/kyu_7/kyu_7.growing_plant.readme.rst diff --git a/docs/kyu_7/kyu_7.growing_plant.module.rst b/docs/kyu_7/kyu_7.growing_plant.module.rst new file mode 100644 index 00000000000..c01a0af015b --- /dev/null +++ b/docs/kyu_7/kyu_7.growing_plant.module.rst @@ -0,0 +1,11 @@ +kyu\_7.growing\_plant.module package +==================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.growing_plant.readme + kyu_7.growing_plant \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.growing_plant.readme.rst b/docs/kyu_7/kyu_7.growing_plant.readme.rst new file mode 100644 index 00000000000..f10e0c87f5a --- /dev/null +++ b/docs/kyu_7/kyu_7.growing_plant.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/growing_plant/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 6d22f6da757..3e06e449009 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -19,7 +19,7 @@ Subpackages kyu_7.find_the_longest_gap.module kyu_7.formatting_decimal_places_1.module kyu_7.fun_with_lists_length.module - kyu_7.growing_plant + kyu_7.growing_plant.module kyu_7.help_bob_count_letters_and_digits kyu_7.isograms kyu_7.jaden_casing_strings From 392ac9d15441afb771172eacd949cf822eaae0ef Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:33:56 -0800 Subject: [PATCH 017/107] help_bob_count_letters_and_digits --- ...kyu_7.help_bob_count_letters_and_digits.module.rst | 11 +++++++++++ ...kyu_7.help_bob_count_letters_and_digits.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.module.rst create mode 100644 docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.readme.rst diff --git a/docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.module.rst b/docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.module.rst new file mode 100644 index 00000000000..bce85d377c8 --- /dev/null +++ b/docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.module.rst @@ -0,0 +1,11 @@ +kyu\_7.help\_bob\_count\_letters\_and\_digits.module package +============================================================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.help_bob_count_letters_and_digits.readme + kyu_7.help_bob_count_letters_and_digits \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.readme.rst b/docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.readme.rst new file mode 100644 index 00000000000..45489503d53 --- /dev/null +++ b/docs/kyu_7/kyu_7.help_bob_count_letters_and_digits.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/help_bob_count_letters_and_digits/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 3e06e449009..eb3d5015d0f 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -20,7 +20,7 @@ Subpackages kyu_7.formatting_decimal_places_1.module kyu_7.fun_with_lists_length.module kyu_7.growing_plant.module - kyu_7.help_bob_count_letters_and_digits + kyu_7.help_bob_count_letters_and_digits.module kyu_7.isograms kyu_7.jaden_casing_strings kyu_7.make_class From 1e2d86ad47419ea690ce521bf17903d98cd901ff Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:35:44 -0800 Subject: [PATCH 018/107] isograms --- docs/kyu_7/kyu_7.isograms.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.isograms.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.isograms.module.rst create mode 100644 docs/kyu_7/kyu_7.isograms.readme.rst diff --git a/docs/kyu_7/kyu_7.isograms.module.rst b/docs/kyu_7/kyu_7.isograms.module.rst new file mode 100644 index 00000000000..4c625d07f65 --- /dev/null +++ b/docs/kyu_7/kyu_7.isograms.module.rst @@ -0,0 +1,11 @@ +kyu\_7.isograms.module package +============================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.isograms.readme + kyu_7.isograms \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.isograms.readme.rst b/docs/kyu_7/kyu_7.isograms.readme.rst new file mode 100644 index 00000000000..209bd441727 --- /dev/null +++ b/docs/kyu_7/kyu_7.isograms.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/isograms/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index eb3d5015d0f..3a3f4d5d42a 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -21,7 +21,7 @@ Subpackages kyu_7.fun_with_lists_length.module kyu_7.growing_plant.module kyu_7.help_bob_count_letters_and_digits.module - kyu_7.isograms + kyu_7.isograms.module kyu_7.jaden_casing_strings kyu_7.make_class kyu_7.maximum_multiple From a666bb5882e8d482d0f2a1b0833085a685fe06e3 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:38:18 -0800 Subject: [PATCH 019/107] jaden_casing_strings --- docs/kyu_7/kyu_7.jaden_casing_strings.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.jaden_casing_strings.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.jaden_casing_strings.module.rst create mode 100644 docs/kyu_7/kyu_7.jaden_casing_strings.readme.rst diff --git a/docs/kyu_7/kyu_7.jaden_casing_strings.module.rst b/docs/kyu_7/kyu_7.jaden_casing_strings.module.rst new file mode 100644 index 00000000000..62fbc40e98e --- /dev/null +++ b/docs/kyu_7/kyu_7.jaden_casing_strings.module.rst @@ -0,0 +1,11 @@ +kyu\_7.jaden\_casing\_strings.module package +============================================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.jaden_casing_strings.readme + kyu_7.jaden_casing_strings \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.jaden_casing_strings.readme.rst b/docs/kyu_7/kyu_7.jaden_casing_strings.readme.rst new file mode 100644 index 00000000000..d9b457746cb --- /dev/null +++ b/docs/kyu_7/kyu_7.jaden_casing_strings.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/jaden_casing_strings/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 3a3f4d5d42a..4d172ade003 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -22,7 +22,7 @@ Subpackages kyu_7.growing_plant.module kyu_7.help_bob_count_letters_and_digits.module kyu_7.isograms.module - kyu_7.jaden_casing_strings + kyu_7.jaden_casing_strings.module kyu_7.make_class kyu_7.maximum_multiple kyu_7.password_validator From 794cd434589e3938ed12e75b734a54328cbbfa19 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:42:34 -0800 Subject: [PATCH 020/107] make_class --- docs/kyu_7/kyu_7.make_class.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.make_class.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.make_class.module.rst create mode 100644 docs/kyu_7/kyu_7.make_class.readme.rst diff --git a/docs/kyu_7/kyu_7.make_class.module.rst b/docs/kyu_7/kyu_7.make_class.module.rst new file mode 100644 index 00000000000..a0d1669c813 --- /dev/null +++ b/docs/kyu_7/kyu_7.make_class.module.rst @@ -0,0 +1,11 @@ +kyu\_7.make\_class.module package +================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.make_class.readme + kyu_7.make_class \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.make_class.readme.rst b/docs/kyu_7/kyu_7.make_class.readme.rst new file mode 100644 index 00000000000..1d0995049c6 --- /dev/null +++ b/docs/kyu_7/kyu_7.make_class.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/make_class/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 4d172ade003..e2b1ac2a031 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -23,7 +23,7 @@ Subpackages kyu_7.help_bob_count_letters_and_digits.module kyu_7.isograms.module kyu_7.jaden_casing_strings.module - kyu_7.make_class + kyu_7.make_class.module kyu_7.maximum_multiple kyu_7.password_validator kyu_7.powers_of_3 From 558dc42a6bb70736c3850df0997a6e7068ffaa05 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:46:17 -0800 Subject: [PATCH 021/107] maximum_multiple --- docs/kyu_7/kyu_7.maximum_multiple.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.maximum_multiple.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.maximum_multiple.module.rst create mode 100644 docs/kyu_7/kyu_7.maximum_multiple.readme.rst diff --git a/docs/kyu_7/kyu_7.maximum_multiple.module.rst b/docs/kyu_7/kyu_7.maximum_multiple.module.rst new file mode 100644 index 00000000000..f8e218fa610 --- /dev/null +++ b/docs/kyu_7/kyu_7.maximum_multiple.module.rst @@ -0,0 +1,11 @@ +kyu\_7.maximum\_multiple.module package +======================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.maximum_multiple.readme + kyu_7.maximum_multiple \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.maximum_multiple.readme.rst b/docs/kyu_7/kyu_7.maximum_multiple.readme.rst new file mode 100644 index 00000000000..b0ba33b6e00 --- /dev/null +++ b/docs/kyu_7/kyu_7.maximum_multiple.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/maximum_multiple/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index e2b1ac2a031..21d7f4b6024 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -24,7 +24,7 @@ Subpackages kyu_7.isograms.module kyu_7.jaden_casing_strings.module kyu_7.make_class.module - kyu_7.maximum_multiple + kyu_7.maximum_multiple.module kyu_7.password_validator kyu_7.powers_of_3 kyu_7.pull_your_words_together_man From 5f54eae1e087b55105f2fa91bd42a23e3796f279 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 03:59:08 -0800 Subject: [PATCH 022/107] password_validator --- docs/kyu_7/kyu_7.password_validator.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.password_validator.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.password_validator.module.rst create mode 100644 docs/kyu_7/kyu_7.password_validator.readme.rst diff --git a/docs/kyu_7/kyu_7.password_validator.module.rst b/docs/kyu_7/kyu_7.password_validator.module.rst new file mode 100644 index 00000000000..5b2bd79d7e0 --- /dev/null +++ b/docs/kyu_7/kyu_7.password_validator.module.rst @@ -0,0 +1,11 @@ +kyu\_7.password_validator.module package +======================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.password_validator.readme + kyu_7.password_validator \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.password_validator.readme.rst b/docs/kyu_7/kyu_7.password_validator.readme.rst new file mode 100644 index 00000000000..129f4c3581b --- /dev/null +++ b/docs/kyu_7/kyu_7.password_validator.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/password_validator/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 21d7f4b6024..ef3179f8367 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -25,7 +25,7 @@ Subpackages kyu_7.jaden_casing_strings.module kyu_7.make_class.module kyu_7.maximum_multiple.module - kyu_7.password_validator + kyu_7.password_validator.module kyu_7.powers_of_3 kyu_7.pull_your_words_together_man kyu_7.remove_the_minimum From 72c57569995b92be03ea85ca6f8154a97701177c Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 04:02:12 -0800 Subject: [PATCH 023/107] powers_of_3 --- docs/kyu_7/kyu_7.powers_of_3.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.powers_of_3.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.powers_of_3.module.rst create mode 100644 docs/kyu_7/kyu_7.powers_of_3.readme.rst diff --git a/docs/kyu_7/kyu_7.powers_of_3.module.rst b/docs/kyu_7/kyu_7.powers_of_3.module.rst new file mode 100644 index 00000000000..5b48071c7d2 --- /dev/null +++ b/docs/kyu_7/kyu_7.powers_of_3.module.rst @@ -0,0 +1,11 @@ +kyu\_7.powers\_of\_3.module package +=================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.powers_of_3.readme + kyu_7.powers_of_3 \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.powers_of_3.readme.rst b/docs/kyu_7/kyu_7.powers_of_3.readme.rst new file mode 100644 index 00000000000..ab82c6f5d29 --- /dev/null +++ b/docs/kyu_7/kyu_7.powers_of_3.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/powers_of_3/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index ef3179f8367..d17bc235548 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -26,7 +26,7 @@ Subpackages kyu_7.make_class.module kyu_7.maximum_multiple.module kyu_7.password_validator.module - kyu_7.powers_of_3 + kyu_7.powers_of_3.module kyu_7.pull_your_words_together_man kyu_7.remove_the_minimum kyu_7.share_prices From 7763ce8fb5607ffb1e5fbcd474883e8662438bf1 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 04:07:04 -0800 Subject: [PATCH 024/107] pull_your_words_together_man --- .../kyu_7.pull_your_words_together_man.module.rst | 11 +++++++++++ .../kyu_7.pull_your_words_together_man.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.pull_your_words_together_man.module.rst create mode 100644 docs/kyu_7/kyu_7.pull_your_words_together_man.readme.rst diff --git a/docs/kyu_7/kyu_7.pull_your_words_together_man.module.rst b/docs/kyu_7/kyu_7.pull_your_words_together_man.module.rst new file mode 100644 index 00000000000..f4a2b7be655 --- /dev/null +++ b/docs/kyu_7/kyu_7.pull_your_words_together_man.module.rst @@ -0,0 +1,11 @@ +kyu\_7.pull\_your\_words\_together\_man.module package +====================================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.pull_your_words_together_man.readme + kyu_7.pull_your_words_together_man \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.pull_your_words_together_man.readme.rst b/docs/kyu_7/kyu_7.pull_your_words_together_man.readme.rst new file mode 100644 index 00000000000..d6e45369fff --- /dev/null +++ b/docs/kyu_7/kyu_7.pull_your_words_together_man.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/pull_your_words_together_man/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index d17bc235548..4dcef2120d5 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -27,7 +27,7 @@ Subpackages kyu_7.maximum_multiple.module kyu_7.password_validator.module kyu_7.powers_of_3.module - kyu_7.pull_your_words_together_man + kyu_7.pull_your_words_together_man.module kyu_7.remove_the_minimum kyu_7.share_prices kyu_7.significant_figures From 02c8097812af73cbd417d7dd0572666b3cdc07c8 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 04:09:41 -0800 Subject: [PATCH 025/107] remove_the_minimum --- docs/kyu_7/kyu_7.remove_the_minimum.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.remove_the_minimum.readme.rst | 5 +++++ docs/kyu_7/kyu_7.rst | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.remove_the_minimum.module.rst create mode 100644 docs/kyu_7/kyu_7.remove_the_minimum.readme.rst diff --git a/docs/kyu_7/kyu_7.remove_the_minimum.module.rst b/docs/kyu_7/kyu_7.remove_the_minimum.module.rst new file mode 100644 index 00000000000..57bcb931575 --- /dev/null +++ b/docs/kyu_7/kyu_7.remove_the_minimum.module.rst @@ -0,0 +1,11 @@ +kyu\_7.remove\_the\_minimum.module package +========================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.remove_the_minimum.readme + kyu_7.remove_the_minimum \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.remove_the_minimum.readme.rst b/docs/kyu_7/kyu_7.remove_the_minimum.readme.rst new file mode 100644 index 00000000000..735e7bb016d --- /dev/null +++ b/docs/kyu_7/kyu_7.remove_the_minimum.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/remove_the_minimum/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 4dcef2120d5..7872e1f8ec1 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -28,7 +28,7 @@ Subpackages kyu_7.password_validator.module kyu_7.powers_of_3.module kyu_7.pull_your_words_together_man.module - kyu_7.remove_the_minimum + kyu_7.remove_the_minimum.module kyu_7.share_prices kyu_7.significant_figures kyu_7.simple_fun_152 From 997f0f5baaa68e1ef19d066130777d7a18d0b28d Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 04:11:46 -0800 Subject: [PATCH 026/107] share_prices --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.share_prices.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.share_prices.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.share_prices.module.rst create mode 100644 docs/kyu_7/kyu_7.share_prices.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 7872e1f8ec1..ad9b5d14f12 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -29,7 +29,7 @@ Subpackages kyu_7.powers_of_3.module kyu_7.pull_your_words_together_man.module kyu_7.remove_the_minimum.module - kyu_7.share_prices + kyu_7.share_prices.module kyu_7.significant_figures kyu_7.simple_fun_152 kyu_7.sort_out_the_men_from_boys diff --git a/docs/kyu_7/kyu_7.share_prices.module.rst b/docs/kyu_7/kyu_7.share_prices.module.rst new file mode 100644 index 00000000000..96557ac81bc --- /dev/null +++ b/docs/kyu_7/kyu_7.share_prices.module.rst @@ -0,0 +1,11 @@ +kyu\_7.share\_prices.module package +=================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.share_prices.readme + kyu_7.share_prices \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.share_prices.readme.rst b/docs/kyu_7/kyu_7.share_prices.readme.rst new file mode 100644 index 00000000000..cc12c7f8233 --- /dev/null +++ b/docs/kyu_7/kyu_7.share_prices.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/share_prices/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 29f6fb194e7bc06a8ba4b96d1916671ab9d6f92e Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 04:14:36 -0800 Subject: [PATCH 027/107] significant_figures --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.significant_figures.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.significant_figures.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.significant_figures.module.rst create mode 100644 docs/kyu_7/kyu_7.significant_figures.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index ad9b5d14f12..9a218b8a630 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -30,7 +30,7 @@ Subpackages kyu_7.pull_your_words_together_man.module kyu_7.remove_the_minimum.module kyu_7.share_prices.module - kyu_7.significant_figures + kyu_7.significant_figures.module kyu_7.simple_fun_152 kyu_7.sort_out_the_men_from_boys kyu_7.substituting_variables_into_strings_padded_numbers diff --git a/docs/kyu_7/kyu_7.significant_figures.module.rst b/docs/kyu_7/kyu_7.significant_figures.module.rst new file mode 100644 index 00000000000..4d46789e4f5 --- /dev/null +++ b/docs/kyu_7/kyu_7.significant_figures.module.rst @@ -0,0 +1,11 @@ +kyu\_7.significant_figures.module package +========================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.significant_figures.readme + kyu_7.significant_figures \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.significant_figures.readme.rst b/docs/kyu_7/kyu_7.significant_figures.readme.rst new file mode 100644 index 00000000000..a3962720d63 --- /dev/null +++ b/docs/kyu_7/kyu_7.significant_figures.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/significant_figures/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 790aef421a6c0fa458578b3ac749bd20ee94cb48 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 04:18:42 -0800 Subject: [PATCH 028/107] simple_fun_152 --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.simple_fun_152.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.simple_fun_152.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.simple_fun_152.module.rst create mode 100644 docs/kyu_7/kyu_7.simple_fun_152.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 9a218b8a630..6b1665e7ee6 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -31,7 +31,7 @@ Subpackages kyu_7.remove_the_minimum.module kyu_7.share_prices.module kyu_7.significant_figures.module - kyu_7.simple_fun_152 + kyu_7.simple_fun_152.module kyu_7.sort_out_the_men_from_boys kyu_7.substituting_variables_into_strings_padded_numbers kyu_7.sum_of_odd_numbers diff --git a/docs/kyu_7/kyu_7.simple_fun_152.module.rst b/docs/kyu_7/kyu_7.simple_fun_152.module.rst new file mode 100644 index 00000000000..3743a5c0b6e --- /dev/null +++ b/docs/kyu_7/kyu_7.simple_fun_152.module.rst @@ -0,0 +1,11 @@ +kyu\_7.simple\_fun\_152.module package +====================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.simple_fun_152.readme + kyu_7.simple_fun_152 \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.simple_fun_152.readme.rst b/docs/kyu_7/kyu_7.simple_fun_152.readme.rst new file mode 100644 index 00000000000..c74a2bc072e --- /dev/null +++ b/docs/kyu_7/kyu_7.simple_fun_152.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/simple_fun_152/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 52d9334390d89358f6df58e729c948c5a684f8c4 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 04:20:40 -0800 Subject: [PATCH 029/107] sort_out_the_men_from_boys --- docs/kyu_7/kyu_7.rst | 2 +- .../kyu_7/kyu_7.sort_out_the_men_from_boys.module.rst | 11 +++++++++++ .../kyu_7/kyu_7.sort_out_the_men_from_boys.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.sort_out_the_men_from_boys.module.rst create mode 100644 docs/kyu_7/kyu_7.sort_out_the_men_from_boys.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 6b1665e7ee6..bafcaf38a36 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -32,7 +32,7 @@ Subpackages kyu_7.share_prices.module kyu_7.significant_figures.module kyu_7.simple_fun_152.module - kyu_7.sort_out_the_men_from_boys + kyu_7.sort_out_the_men_from_boys.module kyu_7.substituting_variables_into_strings_padded_numbers kyu_7.sum_of_odd_numbers kyu_7.sum_of_powers_of_2 diff --git a/docs/kyu_7/kyu_7.sort_out_the_men_from_boys.module.rst b/docs/kyu_7/kyu_7.sort_out_the_men_from_boys.module.rst new file mode 100644 index 00000000000..d0640ead849 --- /dev/null +++ b/docs/kyu_7/kyu_7.sort_out_the_men_from_boys.module.rst @@ -0,0 +1,11 @@ +kyu\_7.sort\_out\_the\_men\_from\_boys.module package +===================================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.sort_out_the_men_from_boys.readme + kyu_7.sort_out_the_men_from_boys \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.sort_out_the_men_from_boys.readme.rst b/docs/kyu_7/kyu_7.sort_out_the_men_from_boys.readme.rst new file mode 100644 index 00000000000..845c65784e7 --- /dev/null +++ b/docs/kyu_7/kyu_7.sort_out_the_men_from_boys.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/sort_out_the_men_from_boys/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 22cbe472549df6c6d422229204e93b6943eddb4c Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 04:28:33 -0800 Subject: [PATCH 030/107] substituting_variables_into_strings_padded_numbers --- docs/kyu_7/kyu_7.rst | 2 +- ...g_variables_into_strings_padded_numbers.module.rst | 11 +++++++++++ ...g_variables_into_strings_padded_numbers.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.module.rst create mode 100644 docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index bafcaf38a36..b16b10237ba 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -33,7 +33,7 @@ Subpackages kyu_7.significant_figures.module kyu_7.simple_fun_152.module kyu_7.sort_out_the_men_from_boys.module - kyu_7.substituting_variables_into_strings_padded_numbers + kyu_7.substituting_variables_into_strings_padded_numbers.module kyu_7.sum_of_odd_numbers kyu_7.sum_of_powers_of_2 kyu_7.sum_of_triangular_numbers diff --git a/docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.module.rst b/docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.module.rst new file mode 100644 index 00000000000..f3b3b18f69b --- /dev/null +++ b/docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.module.rst @@ -0,0 +1,11 @@ +kyu\_7.substituting\_variables\_into\_strings\_padded\_numbers.module package +============================================================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.substituting_variables_into_strings_padded_numbers.readme + kyu_7.substituting_variables_into_strings_padded_numbers \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.readme.rst b/docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.readme.rst new file mode 100644 index 00000000000..bea2e0f6ad6 --- /dev/null +++ b/docs/kyu_7/kyu_7.substituting_variables_into_strings_padded_numbers.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/substituting_variables_into_strings_padded_numbers/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 4c6bf74b69eaff263106406759b86557c90e6b0b Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 12:59:05 -0800 Subject: [PATCH 031/107] sum_of_odd_numbers --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.sum_of_odd_numbers.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst create mode 100644 docs/kyu_7/kyu_7.sum_of_odd_numbers.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index b16b10237ba..3725d5234b6 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -34,7 +34,7 @@ Subpackages kyu_7.simple_fun_152.module kyu_7.sort_out_the_men_from_boys.module kyu_7.substituting_variables_into_strings_padded_numbers.module - kyu_7.sum_of_odd_numbers + kyu_7.sum_of_odd_numbers.module kyu_7.sum_of_powers_of_2 kyu_7.sum_of_triangular_numbers kyu_7.sum_of_two_lowest_int diff --git a/docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst b/docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst new file mode 100644 index 00000000000..90e13d40be0 --- /dev/null +++ b/docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst @@ -0,0 +1,11 @@ +kyu\_7.sum_of_odd_numbers.module package +======================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.sum_of_odd_numbers.readme + kyu_7.sum_of_odd_numbers \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.sum_of_odd_numbers.readme.rst b/docs/kyu_7/kyu_7.sum_of_odd_numbers.readme.rst new file mode 100644 index 00000000000..e2b5eb130d4 --- /dev/null +++ b/docs/kyu_7/kyu_7.sum_of_odd_numbers.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/sum_of_odd_numbers/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 4ed2375fa1e68966b5360b16e876855bf0ea783b Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:02:34 -0800 Subject: [PATCH 032/107] sum_of_powers_of_2 --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.sum_of_powers_of_2.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.sum_of_powers_of_2.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.sum_of_powers_of_2.module.rst create mode 100644 docs/kyu_7/kyu_7.sum_of_powers_of_2.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 3725d5234b6..3b81cadfbf9 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -35,7 +35,7 @@ Subpackages kyu_7.sort_out_the_men_from_boys.module kyu_7.substituting_variables_into_strings_padded_numbers.module kyu_7.sum_of_odd_numbers.module - kyu_7.sum_of_powers_of_2 + kyu_7.sum_of_powers_of_2.module kyu_7.sum_of_triangular_numbers kyu_7.sum_of_two_lowest_int kyu_7.the_first_non_repeated_character_in_string diff --git a/docs/kyu_7/kyu_7.sum_of_powers_of_2.module.rst b/docs/kyu_7/kyu_7.sum_of_powers_of_2.module.rst new file mode 100644 index 00000000000..5b27a25bd9f --- /dev/null +++ b/docs/kyu_7/kyu_7.sum_of_powers_of_2.module.rst @@ -0,0 +1,11 @@ +kyu\_7.sum\_of\_powers\_of\_2.module package +============================================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.sum_of_powers_of_2.readme + kyu_7.sum_of_powers_of_2 \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.sum_of_powers_of_2.readme.rst b/docs/kyu_7/kyu_7.sum_of_powers_of_2.readme.rst new file mode 100644 index 00000000000..ee312f5190a --- /dev/null +++ b/docs/kyu_7/kyu_7.sum_of_powers_of_2.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/sum_of_powers_of_2/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From fb1a68274b668e567ecf76d8b8f139b5ede1d0fb Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:05:19 -0800 Subject: [PATCH 033/107] sum_of_odd_numbers --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 3b81cadfbf9..239765c5217 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -36,7 +36,7 @@ Subpackages kyu_7.substituting_variables_into_strings_padded_numbers.module kyu_7.sum_of_odd_numbers.module kyu_7.sum_of_powers_of_2.module - kyu_7.sum_of_triangular_numbers + kyu_7.sum_of_triangular_numbers.module kyu_7.sum_of_two_lowest_int kyu_7.the_first_non_repeated_character_in_string kyu_7.vaporcode diff --git a/docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst b/docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst index 90e13d40be0..7e1597c836a 100644 --- a/docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst +++ b/docs/kyu_7/kyu_7.sum_of_odd_numbers.module.rst @@ -1,5 +1,5 @@ -kyu\_7.sum_of_odd_numbers.module package -======================================== +kyu\_7.sum\_of\_odd\_numbers.module package +=========================================== Subpackages ----------- From cf1ad179daa617699f585b3f83d4296434729f58 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:07:49 -0800 Subject: [PATCH 034/107] sum_of_triangular_numbers --- docs/kyu_7/kyu_7.sum_of_triangular_numbers.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.sum_of_triangular_numbers.readme.rst | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 docs/kyu_7/kyu_7.sum_of_triangular_numbers.module.rst create mode 100644 docs/kyu_7/kyu_7.sum_of_triangular_numbers.readme.rst diff --git a/docs/kyu_7/kyu_7.sum_of_triangular_numbers.module.rst b/docs/kyu_7/kyu_7.sum_of_triangular_numbers.module.rst new file mode 100644 index 00000000000..49a60b27ffb --- /dev/null +++ b/docs/kyu_7/kyu_7.sum_of_triangular_numbers.module.rst @@ -0,0 +1,11 @@ +kyu\_7.sum\_of\_triangular\_numbers.module package +================================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.sum_of_triangular_numbers.readme + kyu_7.sum_of_triangular_numbers \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.sum_of_triangular_numbers.readme.rst b/docs/kyu_7/kyu_7.sum_of_triangular_numbers.readme.rst new file mode 100644 index 00000000000..b34f02f09a8 --- /dev/null +++ b/docs/kyu_7/kyu_7.sum_of_triangular_numbers.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/sum_of_triangular_numbers/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From eefc8bcde1120a17a21e6a038869c3338a96ac75 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:12:05 -0800 Subject: [PATCH 035/107] sum_of_two_lowest_int --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.sum_of_two_lowest_int.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.sum_of_two_lowest_int.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.sum_of_two_lowest_int.module.rst create mode 100644 docs/kyu_7/kyu_7.sum_of_two_lowest_int.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 239765c5217..6eadfb44c2d 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -37,7 +37,7 @@ Subpackages kyu_7.sum_of_odd_numbers.module kyu_7.sum_of_powers_of_2.module kyu_7.sum_of_triangular_numbers.module - kyu_7.sum_of_two_lowest_int + kyu_7.sum_of_two_lowest_int.module kyu_7.the_first_non_repeated_character_in_string kyu_7.vaporcode kyu_7.valid_parentheses diff --git a/docs/kyu_7/kyu_7.sum_of_two_lowest_int.module.rst b/docs/kyu_7/kyu_7.sum_of_two_lowest_int.module.rst new file mode 100644 index 00000000000..4aafc642716 --- /dev/null +++ b/docs/kyu_7/kyu_7.sum_of_two_lowest_int.module.rst @@ -0,0 +1,11 @@ +kyu\_7.sum\_of\_two\_lowest\_int.module package +=============================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.sum_of_two_lowest_int.readme + kyu_7.sum_of_two_lowest_int \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.sum_of_two_lowest_int.readme.rst b/docs/kyu_7/kyu_7.sum_of_two_lowest_int.readme.rst new file mode 100644 index 00000000000..ff0be73e724 --- /dev/null +++ b/docs/kyu_7/kyu_7.sum_of_two_lowest_int.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/sum_of_two_lowest_int/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From ba7d801d47e3b0fbc459fd26b0698cd933934431 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:14:24 -0800 Subject: [PATCH 036/107] the_first_non_repeated_character_in_string --- docs/kyu_7/kyu_7.rst | 2 +- ..._first_non_repeated_character_in_string.module.rst | 11 +++++++++++ ..._first_non_repeated_character_in_string.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.module.rst create mode 100644 docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 6eadfb44c2d..84dda08c68a 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -38,7 +38,7 @@ Subpackages kyu_7.sum_of_powers_of_2.module kyu_7.sum_of_triangular_numbers.module kyu_7.sum_of_two_lowest_int.module - kyu_7.the_first_non_repeated_character_in_string + kyu_7.the_first_non_repeated_character_in_string.module kyu_7.vaporcode kyu_7.valid_parentheses kyu_7.you_are_square diff --git a/docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.module.rst b/docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.module.rst new file mode 100644 index 00000000000..ed906b8ef2a --- /dev/null +++ b/docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.module.rst @@ -0,0 +1,11 @@ +kyu\_7.the\_first\_non\_repeated\_character\_in\_string.module package +====================================================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.the_first_non_repeated_character_in_string.readme + kyu_7.the_first_non_repeated_character_in_string \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.readme.rst b/docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.readme.rst new file mode 100644 index 00000000000..dfb31fd7396 --- /dev/null +++ b/docs/kyu_7/kyu_7.the_first_non_repeated_character_in_string.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/the_first_non_repeated_character_in_string/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 20580dbd6bb8cf09c9167ba79ceda8847edf33b8 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:16:52 -0800 Subject: [PATCH 037/107] valid_parentheses --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.valid_parentheses.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.valid_parentheses.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.valid_parentheses.module.rst create mode 100644 docs/kyu_7/kyu_7.valid_parentheses.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 84dda08c68a..955aabaaaae 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -39,8 +39,8 @@ Subpackages kyu_7.sum_of_triangular_numbers.module kyu_7.sum_of_two_lowest_int.module kyu_7.the_first_non_repeated_character_in_string.module + kyu_7.valid_parentheses.module kyu_7.vaporcode - kyu_7.valid_parentheses kyu_7.you_are_square Module contents diff --git a/docs/kyu_7/kyu_7.valid_parentheses.module.rst b/docs/kyu_7/kyu_7.valid_parentheses.module.rst new file mode 100644 index 00000000000..65fafdcea5b --- /dev/null +++ b/docs/kyu_7/kyu_7.valid_parentheses.module.rst @@ -0,0 +1,11 @@ +kyu\_7.valid\_parentheses.module package +======================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.valid_parentheses.readme + kyu_7.valid_parentheses \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.valid_parentheses.readme.rst b/docs/kyu_7/kyu_7.valid_parentheses.readme.rst new file mode 100644 index 00000000000..c30f6ea6f1e --- /dev/null +++ b/docs/kyu_7/kyu_7.valid_parentheses.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/valid_parentheses/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 8e2ecace7ef1efb5a60dc465e2ad756a176334b5 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:21:30 -0800 Subject: [PATCH 038/107] vaporcode --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.vaporcode.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.vaporcode.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.vaporcode.module.rst create mode 100644 docs/kyu_7/kyu_7.vaporcode.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 955aabaaaae..3228017f2a9 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -40,7 +40,7 @@ Subpackages kyu_7.sum_of_two_lowest_int.module kyu_7.the_first_non_repeated_character_in_string.module kyu_7.valid_parentheses.module - kyu_7.vaporcode + kyu_7.vaporcode.module kyu_7.you_are_square Module contents diff --git a/docs/kyu_7/kyu_7.vaporcode.module.rst b/docs/kyu_7/kyu_7.vaporcode.module.rst new file mode 100644 index 00000000000..0487391d70e --- /dev/null +++ b/docs/kyu_7/kyu_7.vaporcode.module.rst @@ -0,0 +1,11 @@ +kyu\_7.vaporcode.module package +=============================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.vaporcode.readme + kyu_7.vaporcode \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.vaporcode.readme.rst b/docs/kyu_7/kyu_7.vaporcode.readme.rst new file mode 100644 index 00000000000..76118ef8c59 --- /dev/null +++ b/docs/kyu_7/kyu_7.vaporcode.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/vaporcode/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 1c4d4ae76788488563b2710a86ecd87d638155bf Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:25:54 -0800 Subject: [PATCH 039/107] you_are_square --- docs/kyu_7/kyu_7.rst | 2 +- docs/kyu_7/kyu_7.you_are_square.module.rst | 11 +++++++++++ docs/kyu_7/kyu_7.you_are_square.readme.rst | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/kyu_7/kyu_7.you_are_square.module.rst create mode 100644 docs/kyu_7/kyu_7.you_are_square.readme.rst diff --git a/docs/kyu_7/kyu_7.rst b/docs/kyu_7/kyu_7.rst index 3228017f2a9..0542201924d 100644 --- a/docs/kyu_7/kyu_7.rst +++ b/docs/kyu_7/kyu_7.rst @@ -41,7 +41,7 @@ Subpackages kyu_7.the_first_non_repeated_character_in_string.module kyu_7.valid_parentheses.module kyu_7.vaporcode.module - kyu_7.you_are_square + kyu_7.you_are_square.module Module contents --------------- diff --git a/docs/kyu_7/kyu_7.you_are_square.module.rst b/docs/kyu_7/kyu_7.you_are_square.module.rst new file mode 100644 index 00000000000..e8ae76c4a77 --- /dev/null +++ b/docs/kyu_7/kyu_7.you_are_square.module.rst @@ -0,0 +1,11 @@ +kyu\_7.you\_are\_square.module package +====================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + kyu_7.you_are_square.readme + kyu_7.you_are_square \ No newline at end of file diff --git a/docs/kyu_7/kyu_7.you_are_square.readme.rst b/docs/kyu_7/kyu_7.you_are_square.readme.rst new file mode 100644 index 00000000000..05c60bd4e5d --- /dev/null +++ b/docs/kyu_7/kyu_7.you_are_square.readme.rst @@ -0,0 +1,5 @@ +README +====== + +.. include:: ../../kyu_7/you_are_square/README.md + :parser: myst_parser.sphinx_ \ No newline at end of file From 90af04dc5c50da3c67cd1ed40e9c8c7e64c747df Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:33:48 -0800 Subject: [PATCH 040/107] kyu_8 --- docs/index.rst | 2 +- docs/{ => kyu_8}/kyu_8.alternating_case.rst | 0 docs/{ => kyu_8}/kyu_8.century_from_year.rst | 0 docs/{ => kyu_8}/kyu_8.check_the_exam.rst | 0 docs/{ => kyu_8}/kyu_8.convert_string_to_an_array.rst | 0 docs/{ => kyu_8}/kyu_8.count_the_monkeys.rst | 0 docs/{ => kyu_8}/kyu_8.counting_sheep.rst | 0 docs/{ => kyu_8}/kyu_8.enumerable_magic_25.rst | 0 .../{ => kyu_8}/kyu_8.find_the_first_non_consecutive_number.rst | 0 docs/{ => kyu_8}/kyu_8.formatting_decimal_places_0.rst | 0 docs/{ => kyu_8}/kyu_8.grasshopper_check_for_factor.rst | 0 docs/{ => kyu_8}/kyu_8.grasshopper_messi_goals_function.rst | 0 docs/{ => kyu_8}/kyu_8.grasshopper_personalized_message.rst | 0 docs/{ => kyu_8}/kyu_8.grasshopper_summation.rst | 0 docs/{ => kyu_8}/kyu_8.greek_sort.rst | 0 docs/{ => kyu_8}/kyu_8.holiday_vi_shark_pontoon.rst | 0 docs/{ => kyu_8}/kyu_8.is_it_a_palindrome.rst | 0 docs/{ => kyu_8}/kyu_8.is_your_period_late.rst | 0 docs/{ => kyu_8}/kyu_8.keep_hydrated.rst | 0 docs/{ => kyu_8}/kyu_8.keep_up_the_hoop.rst | 0 docs/{ => kyu_8}/kyu_8.logical_calculator.rst | 0 docs/{ => kyu_8}/kyu_8.make_upper_case.rst | 0 docs/{ => kyu_8}/kyu_8.multiply.rst | 0 docs/{ => kyu_8}/kyu_8.my_head_is_at_the_wrong_end.rst | 0 docs/{ => kyu_8}/kyu_8.readme.rst | 0 docs/{ => kyu_8}/kyu_8.remove_first_and_last_character.rst | 0 docs/{ => kyu_8}/kyu_8.remove_string_spaces.rst | 0 docs/{ => kyu_8}/kyu_8.reversed_strings.rst | 0 docs/{ => kyu_8}/kyu_8.rst | 0 docs/{ => kyu_8}/kyu_8.set_alarm.rst | 0 docs/{ => kyu_8}/kyu_8.surface_area_and_volume_of_box.rst | 0 docs/{ => kyu_8}/kyu_8.swap_values.rst | 0 docs/{ => kyu_8}/kyu_8.terminal_game_move_function.rst | 0 docs/{ => kyu_8}/kyu_8.the_feast_of_many_beasts.rst | 0 docs/{ => kyu_8}/kyu_8.third_angle_of_triangle.rst | 0 docs/{ => kyu_8}/kyu_8.well_of_ideas_easy_version.rst | 0 docs/{ => kyu_8}/kyu_8.will_there_be_enough_space.rst | 0 docs/{ => kyu_8}/kyu_8.will_you_make_it.rst | 0 docs/{ => kyu_8}/kyu_8.wolf_in_sheep_clothing.rst | 0 39 files changed, 1 insertion(+), 1 deletion(-) rename docs/{ => kyu_8}/kyu_8.alternating_case.rst (100%) rename docs/{ => kyu_8}/kyu_8.century_from_year.rst (100%) rename docs/{ => kyu_8}/kyu_8.check_the_exam.rst (100%) rename docs/{ => kyu_8}/kyu_8.convert_string_to_an_array.rst (100%) rename docs/{ => kyu_8}/kyu_8.count_the_monkeys.rst (100%) rename docs/{ => kyu_8}/kyu_8.counting_sheep.rst (100%) rename docs/{ => kyu_8}/kyu_8.enumerable_magic_25.rst (100%) rename docs/{ => kyu_8}/kyu_8.find_the_first_non_consecutive_number.rst (100%) rename docs/{ => kyu_8}/kyu_8.formatting_decimal_places_0.rst (100%) rename docs/{ => kyu_8}/kyu_8.grasshopper_check_for_factor.rst (100%) rename docs/{ => kyu_8}/kyu_8.grasshopper_messi_goals_function.rst (100%) rename docs/{ => kyu_8}/kyu_8.grasshopper_personalized_message.rst (100%) rename docs/{ => kyu_8}/kyu_8.grasshopper_summation.rst (100%) rename docs/{ => kyu_8}/kyu_8.greek_sort.rst (100%) rename docs/{ => kyu_8}/kyu_8.holiday_vi_shark_pontoon.rst (100%) rename docs/{ => kyu_8}/kyu_8.is_it_a_palindrome.rst (100%) rename docs/{ => kyu_8}/kyu_8.is_your_period_late.rst (100%) rename docs/{ => kyu_8}/kyu_8.keep_hydrated.rst (100%) rename docs/{ => kyu_8}/kyu_8.keep_up_the_hoop.rst (100%) rename docs/{ => kyu_8}/kyu_8.logical_calculator.rst (100%) rename docs/{ => kyu_8}/kyu_8.make_upper_case.rst (100%) rename docs/{ => kyu_8}/kyu_8.multiply.rst (100%) rename docs/{ => kyu_8}/kyu_8.my_head_is_at_the_wrong_end.rst (100%) rename docs/{ => kyu_8}/kyu_8.readme.rst (100%) rename docs/{ => kyu_8}/kyu_8.remove_first_and_last_character.rst (100%) rename docs/{ => kyu_8}/kyu_8.remove_string_spaces.rst (100%) rename docs/{ => kyu_8}/kyu_8.reversed_strings.rst (100%) rename docs/{ => kyu_8}/kyu_8.rst (100%) rename docs/{ => kyu_8}/kyu_8.set_alarm.rst (100%) rename docs/{ => kyu_8}/kyu_8.surface_area_and_volume_of_box.rst (100%) rename docs/{ => kyu_8}/kyu_8.swap_values.rst (100%) rename docs/{ => kyu_8}/kyu_8.terminal_game_move_function.rst (100%) rename docs/{ => kyu_8}/kyu_8.the_feast_of_many_beasts.rst (100%) rename docs/{ => kyu_8}/kyu_8.third_angle_of_triangle.rst (100%) rename docs/{ => kyu_8}/kyu_8.well_of_ideas_easy_version.rst (100%) rename docs/{ => kyu_8}/kyu_8.will_there_be_enough_space.rst (100%) rename docs/{ => kyu_8}/kyu_8.will_you_make_it.rst (100%) rename docs/{ => kyu_8}/kyu_8.wolf_in_sheep_clothing.rst (100%) diff --git a/docs/index.rst b/docs/index.rst index 04a46ebf6c2..392b6ef0422 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,7 +17,7 @@ Welcome to Python3 solutions for codewars problems documentation! kyu_5/kyu_5 kyu_6/kyu_6 kyu_7/kyu_7 - kyu_8 + kyu_8/kyu_8 utils Indices and tables diff --git a/docs/kyu_8.alternating_case.rst b/docs/kyu_8/kyu_8.alternating_case.rst similarity index 100% rename from docs/kyu_8.alternating_case.rst rename to docs/kyu_8/kyu_8.alternating_case.rst diff --git a/docs/kyu_8.century_from_year.rst b/docs/kyu_8/kyu_8.century_from_year.rst similarity index 100% rename from docs/kyu_8.century_from_year.rst rename to docs/kyu_8/kyu_8.century_from_year.rst diff --git a/docs/kyu_8.check_the_exam.rst b/docs/kyu_8/kyu_8.check_the_exam.rst similarity index 100% rename from docs/kyu_8.check_the_exam.rst rename to docs/kyu_8/kyu_8.check_the_exam.rst diff --git a/docs/kyu_8.convert_string_to_an_array.rst b/docs/kyu_8/kyu_8.convert_string_to_an_array.rst similarity index 100% rename from docs/kyu_8.convert_string_to_an_array.rst rename to docs/kyu_8/kyu_8.convert_string_to_an_array.rst diff --git a/docs/kyu_8.count_the_monkeys.rst b/docs/kyu_8/kyu_8.count_the_monkeys.rst similarity index 100% rename from docs/kyu_8.count_the_monkeys.rst rename to docs/kyu_8/kyu_8.count_the_monkeys.rst diff --git a/docs/kyu_8.counting_sheep.rst b/docs/kyu_8/kyu_8.counting_sheep.rst similarity index 100% rename from docs/kyu_8.counting_sheep.rst rename to docs/kyu_8/kyu_8.counting_sheep.rst diff --git a/docs/kyu_8.enumerable_magic_25.rst b/docs/kyu_8/kyu_8.enumerable_magic_25.rst similarity index 100% rename from docs/kyu_8.enumerable_magic_25.rst rename to docs/kyu_8/kyu_8.enumerable_magic_25.rst diff --git a/docs/kyu_8.find_the_first_non_consecutive_number.rst b/docs/kyu_8/kyu_8.find_the_first_non_consecutive_number.rst similarity index 100% rename from docs/kyu_8.find_the_first_non_consecutive_number.rst rename to docs/kyu_8/kyu_8.find_the_first_non_consecutive_number.rst diff --git a/docs/kyu_8.formatting_decimal_places_0.rst b/docs/kyu_8/kyu_8.formatting_decimal_places_0.rst similarity index 100% rename from docs/kyu_8.formatting_decimal_places_0.rst rename to docs/kyu_8/kyu_8.formatting_decimal_places_0.rst diff --git a/docs/kyu_8.grasshopper_check_for_factor.rst b/docs/kyu_8/kyu_8.grasshopper_check_for_factor.rst similarity index 100% rename from docs/kyu_8.grasshopper_check_for_factor.rst rename to docs/kyu_8/kyu_8.grasshopper_check_for_factor.rst diff --git a/docs/kyu_8.grasshopper_messi_goals_function.rst b/docs/kyu_8/kyu_8.grasshopper_messi_goals_function.rst similarity index 100% rename from docs/kyu_8.grasshopper_messi_goals_function.rst rename to docs/kyu_8/kyu_8.grasshopper_messi_goals_function.rst diff --git a/docs/kyu_8.grasshopper_personalized_message.rst b/docs/kyu_8/kyu_8.grasshopper_personalized_message.rst similarity index 100% rename from docs/kyu_8.grasshopper_personalized_message.rst rename to docs/kyu_8/kyu_8.grasshopper_personalized_message.rst diff --git a/docs/kyu_8.grasshopper_summation.rst b/docs/kyu_8/kyu_8.grasshopper_summation.rst similarity index 100% rename from docs/kyu_8.grasshopper_summation.rst rename to docs/kyu_8/kyu_8.grasshopper_summation.rst diff --git a/docs/kyu_8.greek_sort.rst b/docs/kyu_8/kyu_8.greek_sort.rst similarity index 100% rename from docs/kyu_8.greek_sort.rst rename to docs/kyu_8/kyu_8.greek_sort.rst diff --git a/docs/kyu_8.holiday_vi_shark_pontoon.rst b/docs/kyu_8/kyu_8.holiday_vi_shark_pontoon.rst similarity index 100% rename from docs/kyu_8.holiday_vi_shark_pontoon.rst rename to docs/kyu_8/kyu_8.holiday_vi_shark_pontoon.rst diff --git a/docs/kyu_8.is_it_a_palindrome.rst b/docs/kyu_8/kyu_8.is_it_a_palindrome.rst similarity index 100% rename from docs/kyu_8.is_it_a_palindrome.rst rename to docs/kyu_8/kyu_8.is_it_a_palindrome.rst diff --git a/docs/kyu_8.is_your_period_late.rst b/docs/kyu_8/kyu_8.is_your_period_late.rst similarity index 100% rename from docs/kyu_8.is_your_period_late.rst rename to docs/kyu_8/kyu_8.is_your_period_late.rst diff --git a/docs/kyu_8.keep_hydrated.rst b/docs/kyu_8/kyu_8.keep_hydrated.rst similarity index 100% rename from docs/kyu_8.keep_hydrated.rst rename to docs/kyu_8/kyu_8.keep_hydrated.rst diff --git a/docs/kyu_8.keep_up_the_hoop.rst b/docs/kyu_8/kyu_8.keep_up_the_hoop.rst similarity index 100% rename from docs/kyu_8.keep_up_the_hoop.rst rename to docs/kyu_8/kyu_8.keep_up_the_hoop.rst diff --git a/docs/kyu_8.logical_calculator.rst b/docs/kyu_8/kyu_8.logical_calculator.rst similarity index 100% rename from docs/kyu_8.logical_calculator.rst rename to docs/kyu_8/kyu_8.logical_calculator.rst diff --git a/docs/kyu_8.make_upper_case.rst b/docs/kyu_8/kyu_8.make_upper_case.rst similarity index 100% rename from docs/kyu_8.make_upper_case.rst rename to docs/kyu_8/kyu_8.make_upper_case.rst diff --git a/docs/kyu_8.multiply.rst b/docs/kyu_8/kyu_8.multiply.rst similarity index 100% rename from docs/kyu_8.multiply.rst rename to docs/kyu_8/kyu_8.multiply.rst diff --git a/docs/kyu_8.my_head_is_at_the_wrong_end.rst b/docs/kyu_8/kyu_8.my_head_is_at_the_wrong_end.rst similarity index 100% rename from docs/kyu_8.my_head_is_at_the_wrong_end.rst rename to docs/kyu_8/kyu_8.my_head_is_at_the_wrong_end.rst diff --git a/docs/kyu_8.readme.rst b/docs/kyu_8/kyu_8.readme.rst similarity index 100% rename from docs/kyu_8.readme.rst rename to docs/kyu_8/kyu_8.readme.rst diff --git a/docs/kyu_8.remove_first_and_last_character.rst b/docs/kyu_8/kyu_8.remove_first_and_last_character.rst similarity index 100% rename from docs/kyu_8.remove_first_and_last_character.rst rename to docs/kyu_8/kyu_8.remove_first_and_last_character.rst diff --git a/docs/kyu_8.remove_string_spaces.rst b/docs/kyu_8/kyu_8.remove_string_spaces.rst similarity index 100% rename from docs/kyu_8.remove_string_spaces.rst rename to docs/kyu_8/kyu_8.remove_string_spaces.rst diff --git a/docs/kyu_8.reversed_strings.rst b/docs/kyu_8/kyu_8.reversed_strings.rst similarity index 100% rename from docs/kyu_8.reversed_strings.rst rename to docs/kyu_8/kyu_8.reversed_strings.rst diff --git a/docs/kyu_8.rst b/docs/kyu_8/kyu_8.rst similarity index 100% rename from docs/kyu_8.rst rename to docs/kyu_8/kyu_8.rst diff --git a/docs/kyu_8.set_alarm.rst b/docs/kyu_8/kyu_8.set_alarm.rst similarity index 100% rename from docs/kyu_8.set_alarm.rst rename to docs/kyu_8/kyu_8.set_alarm.rst diff --git a/docs/kyu_8.surface_area_and_volume_of_box.rst b/docs/kyu_8/kyu_8.surface_area_and_volume_of_box.rst similarity index 100% rename from docs/kyu_8.surface_area_and_volume_of_box.rst rename to docs/kyu_8/kyu_8.surface_area_and_volume_of_box.rst diff --git a/docs/kyu_8.swap_values.rst b/docs/kyu_8/kyu_8.swap_values.rst similarity index 100% rename from docs/kyu_8.swap_values.rst rename to docs/kyu_8/kyu_8.swap_values.rst diff --git a/docs/kyu_8.terminal_game_move_function.rst b/docs/kyu_8/kyu_8.terminal_game_move_function.rst similarity index 100% rename from docs/kyu_8.terminal_game_move_function.rst rename to docs/kyu_8/kyu_8.terminal_game_move_function.rst diff --git a/docs/kyu_8.the_feast_of_many_beasts.rst b/docs/kyu_8/kyu_8.the_feast_of_many_beasts.rst similarity index 100% rename from docs/kyu_8.the_feast_of_many_beasts.rst rename to docs/kyu_8/kyu_8.the_feast_of_many_beasts.rst diff --git a/docs/kyu_8.third_angle_of_triangle.rst b/docs/kyu_8/kyu_8.third_angle_of_triangle.rst similarity index 100% rename from docs/kyu_8.third_angle_of_triangle.rst rename to docs/kyu_8/kyu_8.third_angle_of_triangle.rst diff --git a/docs/kyu_8.well_of_ideas_easy_version.rst b/docs/kyu_8/kyu_8.well_of_ideas_easy_version.rst similarity index 100% rename from docs/kyu_8.well_of_ideas_easy_version.rst rename to docs/kyu_8/kyu_8.well_of_ideas_easy_version.rst diff --git a/docs/kyu_8.will_there_be_enough_space.rst b/docs/kyu_8/kyu_8.will_there_be_enough_space.rst similarity index 100% rename from docs/kyu_8.will_there_be_enough_space.rst rename to docs/kyu_8/kyu_8.will_there_be_enough_space.rst diff --git a/docs/kyu_8.will_you_make_it.rst b/docs/kyu_8/kyu_8.will_you_make_it.rst similarity index 100% rename from docs/kyu_8.will_you_make_it.rst rename to docs/kyu_8/kyu_8.will_you_make_it.rst diff --git a/docs/kyu_8.wolf_in_sheep_clothing.rst b/docs/kyu_8/kyu_8.wolf_in_sheep_clothing.rst similarity index 100% rename from docs/kyu_8.wolf_in_sheep_clothing.rst rename to docs/kyu_8/kyu_8.wolf_in_sheep_clothing.rst From a50e94755a09d83be24a7d9bcc32d9c9a0e40d23 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:37:59 -0800 Subject: [PATCH 041/107] Update kyu_8.readme.rst --- docs/kyu_8/kyu_8.readme.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kyu_8/kyu_8.readme.rst b/docs/kyu_8/kyu_8.readme.rst index 65a4e32fe24..9507047e52d 100644 --- a/docs/kyu_8/kyu_8.readme.rst +++ b/docs/kyu_8/kyu_8.readme.rst @@ -1,5 +1,5 @@ README ====== -.. include:: ../kyu_8/README.md +.. include:: ../../kyu_8/README.md :parser: myst_parser.sphinx_ \ No newline at end of file From 94ac9d5abee7be6fb6cfeb330a1b802f28aac048 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 13:46:31 -0800 Subject: [PATCH 042/107] Update README.md --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cdec1fb788d..1e7faaefbfa 100644 --- a/README.md +++ b/README.md @@ -354,13 +354,11 @@ the environment for every build, see comment from Grimmy below). <details> <summary>ERROR: The term 'make' is not recognized as the name of a cmdlet</summary> -'make' is not recognized as an internal or external command. - The error "'make' is not recognized as an internal or external command, operable program or batch file" occurs when we run the make command on Windows without having make installed. To solve the error, install make using Chocolatey. -``` +```bash make clean make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. @@ -378,18 +376,18 @@ To install Chocolatey: 1. Open PowerShell as an administrator. 2. Run the following command: - ``` + ```bash Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) ``` 3. Wait for the command to complete. 4. Type choco to make sure Chocolatey is installed: - ``` + ```bash PS C:\WINDOWS\system32> choco Chocolatey v2.4.1 Please run 'choco -?' or 'choco <command> -?' for help menu. ``` 5. Now that you have Chocolatey installed, run the following command to install make: - ``` + ```bash PS C:\WINDOWS\system32> choco install make -y Chocolatey v2.4.1 Installing the following packages: From 7fa7c05b4fdf35d2dbc04d3c84196f006323b833 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 14:03:40 -0800 Subject: [PATCH 043/107] Create pydocstyle_kyu8.yml --- .github/workflows/pydocstyle_kyu8.yml | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/pydocstyle_kyu8.yml diff --git a/.github/workflows/pydocstyle_kyu8.yml b/.github/workflows/pydocstyle_kyu8.yml new file mode 100644 index 00000000000..0757b0c333b --- /dev/null +++ b/.github/workflows/pydocstyle_kyu8.yml @@ -0,0 +1,46 @@ +--- +name: pydocstyle for kyu8 + +on: # yamllint disable-line rule:truthy + push: + branches: + - 'kyu8' + +permissions: + contents: read + pull-requests: read + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.x"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + # This is the version of the action for setting up Python, + # not the Python version. + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + # You can test your matrix by printing the current Python version + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install -r requirements.txt + pip install pydocstyle + pip install types-requests + - name: Check to make sure that the module is in your Python path + run: | + echo $PYTHONPATH + - name: Check pydocstyle version + run: | + pydocstyle --version + - name: Doc style checking with pydocstyle + # Pydocstyle testing (Guide) + # https://www.pydocstyle.org/en/stable/usage.html#cli-usage + run: | + pydocstyle --verbose --explain --count kyu_8 From b58a30c8631fbdb78d9738378d0d8abdfe643de7 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 14:06:42 -0800 Subject: [PATCH 044/107] Update __init__.py --- kyu_8/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kyu_8/__init__.py b/kyu_8/__init__.py index e69de29bb2d..3959b412ade 100644 --- a/kyu_8/__init__.py +++ b/kyu_8/__init__.py @@ -0,0 +1 @@ +"""8 kyu - Beginner package.""" From 4e7cae11fa9d7eacc68c8ab7d87aa930e32e64f0 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 14:14:21 -0800 Subject: [PATCH 045/107] ALTerNAtiNG CaSe --- kyu_8/alternating_case/__init__.py | 1 + kyu_8/alternating_case/alternating_case.py | 11 ++-- .../alternating_case/test_alternating_case.py | 51 +++++++++---------- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/kyu_8/alternating_case/__init__.py b/kyu_8/alternating_case/__init__.py index e69de29bb2d..4463be21191 100644 --- a/kyu_8/alternating_case/__init__.py +++ b/kyu_8/alternating_case/__init__.py @@ -0,0 +1 @@ +"""altERnaTIng cAsE <=> ALTerNAtiNG CaSe.""" diff --git a/kyu_8/alternating_case/alternating_case.py b/kyu_8/alternating_case/alternating_case.py index 06304da424b..44c51a05212 100644 --- a/kyu_8/alternating_case/alternating_case.py +++ b/kyu_8/alternating_case/alternating_case.py @@ -1,5 +1,6 @@ """ -altERnaTIng cAsE <=> ALTerNAtiNG CaSe +altERnaTIng cAsE <=> ALTerNAtiNG CaSe. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,9 +8,11 @@ def to_alternating_case(string: str) -> str: """ + Alternating case. + each lowercase letter becomes uppercase and - each uppercase letter becomes lowercase - :param string: - :return: + each uppercase letter becomes lowercase. + :param string: str + :return: str """ return ''.join((char.upper() if char.islower() else char.lower()) for char in string) diff --git a/kyu_8/alternating_case/test_alternating_case.py b/kyu_8/alternating_case/test_alternating_case.py index e11dc12b8e4..18fc1462444 100644 --- a/kyu_8/alternating_case/test_alternating_case.py +++ b/kyu_8/alternating_case/test_alternating_case.py @@ -1,5 +1,6 @@ """ -Testing for altERnaTIng cAsE <=> ALTerNAtiNG CaSe +Testing for altERnaTIng cAsE <=> ALTerNAtiNG CaSe. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.alternating_case.alternating_case \ import to_alternating_case @@ -26,13 +28,23 @@ name='Source/Kata') # pylint: enable=R0801 class AlternatingCaseTestCase(unittest.TestCase): - """ - Testing to_alternating_case function - """ + """Testing to_alternating_case function.""" - def test_alternating_case(self): + @parameterized.expand([ + ("hello world", "HELLO WORLD"), + ("HELLO WORLD", "hello world"), + ("HeLLo WoRLD", "hEllO wOrld"), + ("hello WORLD", "HELLO world"), + ("12345", "12345"), + ("1a2b3c4d5e", "1A2B3C4D5E"), + ("String.prototype.toAlternatingCase", + "sTRING.PROTOTYPE.TOaLTERNATINGcASE"), + ("Hello World", "hELLO wORLD"), + ("altERnaTIng cAsE", "ALTerNAtiNG CaSe")]) + def test_alternating_case(self, string, expected): """ - Testing to_alternating_case function + Testing to_alternating_case function with various test data. + :return: """ # pylint: disable=R0801 @@ -40,26 +52,13 @@ def test_alternating_case(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 - with allure.step("Enter test string and verify the output"): - test_data: tuple = ( - ("hello world", "HELLO WORLD"), - ("HELLO WORLD", "hello world"), - ("HeLLo WoRLD", "hEllO wOrld"), - ("hello WORLD", "HELLO world"), - ("12345", "12345"), - ("1a2b3c4d5e", "1A2B3C4D5E"), - ("String.prototype.toAlternatingCase", - "sTRING.PROTOTYPE.TOaLTERNATINGcASE"), - ("Hello World", "hELLO wORLD"), - ("altERnaTIng cAsE", "ALTerNAtiNG CaSe")) - - for d in test_data: - string = d[0] - expected = d[1] - print_log(string=string, expected=expected) - self.assertEqual(to_alternating_case(string), expected) + with allure.step(f"Enter test string: {string} " + f"and verify the expected output: {expected}."): + print_log(string=string, expected=expected) + self.assertEqual(to_alternating_case(string), expected) From 8f119481e12168ff46a59eb59580aab471ab24d1 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 14:16:04 -0800 Subject: [PATCH 046/107] Update alternating_case.py --- kyu_8/alternating_case/alternating_case.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/alternating_case/alternating_case.py b/kyu_8/alternating_case/alternating_case.py index 44c51a05212..f298b2e7c23 100644 --- a/kyu_8/alternating_case/alternating_case.py +++ b/kyu_8/alternating_case/alternating_case.py @@ -10,7 +10,7 @@ def to_alternating_case(string: str) -> str: """ Alternating case. - each lowercase letter becomes uppercase and + Each lowercase letter becomes uppercase and each uppercase letter becomes lowercase. :param string: str :return: str From 99ac469e08b75e2e1e2b6ee116be6f1f6e82000a Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 14:25:04 -0800 Subject: [PATCH 047/107] # Century From Year --- kyu_8/century_from_year/__init__.py | 1 + kyu_8/century_from_year/century.py | 6 ++- kyu_8/century_from_year/test_century.py | 58 +++++++++++++------------ 3 files changed, 35 insertions(+), 30 deletions(-) diff --git a/kyu_8/century_from_year/__init__.py b/kyu_8/century_from_year/__init__.py index e69de29bb2d..228c0682982 100644 --- a/kyu_8/century_from_year/__init__.py +++ b/kyu_8/century_from_year/__init__.py @@ -0,0 +1 @@ +"""Century From Year.""" diff --git a/kyu_8/century_from_year/century.py b/kyu_8/century_from_year/century.py index b3687eb368f..b6406ec4aa0 100644 --- a/kyu_8/century_from_year/century.py +++ b/kyu_8/century_from_year/century.py @@ -1,5 +1,6 @@ """ -Solution for -> Century From Year +Solution for -> Century From Year. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,7 +8,8 @@ def century(year: int) -> int: """ - Given a year, return the century it is in + Given a year, return the century it is in. + :param year: int :return: int """ diff --git a/kyu_8/century_from_year/test_century.py b/kyu_8/century_from_year/test_century.py index 1c86b9c549c..37cf962a18b 100644 --- a/kyu_8/century_from_year/test_century.py +++ b/kyu_8/century_from_year/test_century.py @@ -1,5 +1,6 @@ """ -Test for -> Century From Year +Test for -> Century From Year. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -9,6 +10,7 @@ import unittest import allure +from parameterized import parameterized from kyu_8.century_from_year.century import century from utils.log_func import print_log @@ -32,45 +34,45 @@ # pylint: enable-msg=R0801 class CenturyTestCase(unittest.TestCase): """ + Testing century function. + The first century spans from the year 1 up to and including the year 100, The second - from the year 101 up to and including the year 200, etc. """ - def test_century(self): + @parameterized.expand([ + (1705, 18, 'Testing for year 1705'), + (1900, 19, 'Testing for year 1900'), + (1601, 17, 'Testing for year 1601'), + (2000, 20, 'Testing for year 2000'), + (356, 4, 'Testing for year 356'), + (89, 1, 'Testing for year 89')]) + def test_century(self, year, expected, message): """ - Testing century function + Testing century function with various test data. + + :return: """ # pylint: disable-msg=R0801 allure.dynamic.title("Testing century function") allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' - "<p>Given a year, the function should return the century it is in." + "<p>Given a year, the function should return " + "the century it is in." "</p>") # pylint: enable-msg=R0801 - test_data: tuple = ( - (1705, 18, 'Testing for year 1705'), - (1900, 19, 'Testing for year 1900'), - (1601, 17, 'Testing for year 1601'), - (2000, 20, 'Testing for year 2000'), - (356, 4, 'Testing for year 356'), - (89, 1, 'Testing for year 89')) - - for year, expected, message in test_data: - result: int = century(year) - - with allure.step(f"Enter test year ({year}) and verify " - f"the output ({result}) " - f"vs expected ({expected})"): - - print_log(year=year, - result=result, - expected=expected, - message=message) - - self.assertEqual(expected, - result) + result: int = century(year) + with allure.step(f"Enter test year ({year}) and verify " + f"the output ({result}) " + f"vs expected ({expected})"): + print_log(year=year, + result=result, + expected=expected, + message=message) + self.assertEqual(expected, result) From a7119bf09a2a8765cd95cac310d6d866bd6ca244 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Sun, 22 Dec 2024 14:31:13 -0800 Subject: [PATCH 048/107] # Check the exam --- kyu_8/check_the_exam/__init__.py | 1 + kyu_8/check_the_exam/check_exam.py | 8 +++-- kyu_8/check_the_exam/test_check_exam.py | 47 +++++++++++-------------- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/kyu_8/check_the_exam/__init__.py b/kyu_8/check_the_exam/__init__.py index e69de29bb2d..b61f6186057 100644 --- a/kyu_8/check_the_exam/__init__.py +++ b/kyu_8/check_the_exam/__init__.py @@ -0,0 +1 @@ +"""Check the exam.""" diff --git a/kyu_8/check_the_exam/check_exam.py b/kyu_8/check_the_exam/check_exam.py index 319bf5d155f..2651f359112 100644 --- a/kyu_8/check_the_exam/check_exam.py +++ b/kyu_8/check_the_exam/check_exam.py @@ -1,5 +1,6 @@ """ -Solution for -> Check the exam +Solution for -> Check the exam. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,6 +8,8 @@ def check_exam(arr1: list, arr2: list) -> int: """ + Check exam. + The first input array contains the correct answers to an exam, like ["a", "a", "b", "d"]. The second one is "answers" array and contains student's answers. @@ -32,7 +35,8 @@ def check_exam(arr1: list, arr2: list) -> int: def char_processor(char: tuple, results: list) -> None: """ - Processing chars based on specified rule + Processing chars based on specified rule. + :param char: str :param results: list :return: None diff --git a/kyu_8/check_the_exam/test_check_exam.py b/kyu_8/check_the_exam/test_check_exam.py index 8fc45f2098b..ad27e93914a 100644 --- a/kyu_8/check_the_exam/test_check_exam.py +++ b/kyu_8/check_the_exam/test_check_exam.py @@ -1,5 +1,6 @@ """ -Test for -> Check the exam +Test for -> Check the exam. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.check_the_exam.check_exam import check_exam @@ -28,20 +30,21 @@ name='Source/Kata') # pylint: enable=R0801 class CheckExamTestCase(unittest.TestCase): - """ - Testing check_exam function - """ - - def test_check_exam(self): + """Testing check_exam function.""" + + @parameterized.expand([ + (["a", "a", "b", "b"], ["a", "c", "b", "d"], 6), + (["a", "a", "c", "b"], ["a", "a", "b", ""], 7), + (["a", "a", "b", "c"], ["a", "a", "b", "c"], 16), + (["b", "c", "b", "a"], ["", "a", "a", "c"], 0)]) + def test_check_exam(self, arr1, arr2, expected): """ - Testing check_exam function + Testing check_exam function with various test data. - The function should return the score - for this array of answers, giving +4 - for each correct answer, -1 for each - incorrect answer, and +0 for each blank + The function should return the score for this + array of answers, giving +4 for each correct answer, + -1 for each incorrect answer, and +0 for each blank answer(empty string). - :return: """ # pylint: disable=R0801 @@ -49,22 +52,12 @@ def test_check_exam(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 with allure.step("Enter arr1 and arr2 and verify the output"): - data: tuple = ( - (["a", "a", "b", "b"], ["a", "c", "b", "d"], 6), - (["a", "a", "c", "b"], ["a", "a", "b", ""], 7), - (["a", "a", "b", "c"], ["a", "a", "b", "c"], 16), - (["b", "c", "b", "a"], ["", "a", "a", "c"], 0)) - - for arr1, arr2, expected in data: - print_log(arr1=arr1, - arr2=arr2, - expected=expected) - - self.assertEqual(expected, - check_exam(arr1, arr2)) + print_log(arr1=arr1, arr2=arr2, expected=expected) + self.assertEqual(expected, check_exam(arr1, arr2)) From 9a68f048faf41cf50ed5f7b014eff736a8b04e75 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:15:55 -0800 Subject: [PATCH 049/107] # Convert a string to an array --- kyu_8/convert_string_to_an_array/__init__.py | 1 + .../string_to_array.py | 7 ++-- .../test_string_to_array.py | 33 +++++++++---------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/kyu_8/convert_string_to_an_array/__init__.py b/kyu_8/convert_string_to_an_array/__init__.py index e69de29bb2d..a236a70d07e 100644 --- a/kyu_8/convert_string_to_an_array/__init__.py +++ b/kyu_8/convert_string_to_an_array/__init__.py @@ -0,0 +1 @@ +"""Convert a string to an array.""" diff --git a/kyu_8/convert_string_to_an_array/string_to_array.py b/kyu_8/convert_string_to_an_array/string_to_array.py index 724f48905f5..14fa4a648a0 100644 --- a/kyu_8/convert_string_to_an_array/string_to_array.py +++ b/kyu_8/convert_string_to_an_array/string_to_array.py @@ -1,5 +1,6 @@ """ -Solution for -> Convert a string to an array +Solution for -> Convert a string to an array. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,8 +8,8 @@ def string_to_array(s: str) -> list: """ - A function to split a string and - convert it into an array of words + Split a string and convert it into an array of words. + :param s: str :return: list """ diff --git a/kyu_8/convert_string_to_an_array/test_string_to_array.py b/kyu_8/convert_string_to_an_array/test_string_to_array.py index d389160b0cd..72f48dfe51e 100644 --- a/kyu_8/convert_string_to_an_array/test_string_to_array.py +++ b/kyu_8/convert_string_to_an_array/test_string_to_array.py @@ -1,5 +1,6 @@ """ -Test for -> Convert a string to an array +Test for -> Convert a string to an array. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.convert_string_to_an_array.string_to_array \ import string_to_array @@ -28,11 +30,16 @@ name='Source/Kata') # pylint: enable=R0801 class StringToArrayTestCase(unittest.TestCase): - """ - Testing string_to_array function. - """ + """Testing string_to_array function.""" - def test_string_to_array(self): + @parameterized.expand([ + ("Robin Singh", ["Robin", "Singh"]), + ("CodeWars", ["CodeWars"]), + ("I love arrays they are my favorite", + ["I", "love", "arrays", "they", "are", "my", "favorite"]), + ("1 2 3", ["1", "2", "3"]), + ("", [""])]) + def test_string_to_array(self, s, expected): """ Testing string_to_array function. @@ -50,15 +57,7 @@ def test_string_to_array(self): '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 - with allure.step("Enter a test string and verify the output"): - test_data: tuple = ( - ("Robin Singh", ["Robin", "Singh"]), - ("CodeWars", ["CodeWars"]), - ("I love arrays they are my favorite", - ["I", "love", "arrays", "they", "are", "my", "favorite"]), - ("1 2 3", ["1", "2", "3"]), - ("", [""])) - - for s, expected in test_data: - print_log(s=s, expected=expected) - self.assertEqual(expected, string_to_array(s)) + with allure.step(f"Enter a test string: {s} " + f"and verify the output: {expected}."): + print_log(s=s, expected=expected) + self.assertEqual(expected, string_to_array(s)) From e2654a6522fd7a2dc556f3e773bd26bbe99508fe Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:22:14 -0800 Subject: [PATCH 050/107] Count the Monkeys!. --- kyu_8/count_the_monkeys/__init__.py | 1 + kyu_8/count_the_monkeys/monkey_count.py | 5 ++- kyu_8/count_the_monkeys/test_monkey_count.py | 37 ++++++++++---------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/kyu_8/count_the_monkeys/__init__.py b/kyu_8/count_the_monkeys/__init__.py index e69de29bb2d..3eca16bf08d 100644 --- a/kyu_8/count_the_monkeys/__init__.py +++ b/kyu_8/count_the_monkeys/__init__.py @@ -0,0 +1 @@ +"""Count the Monkeys.""" diff --git a/kyu_8/count_the_monkeys/monkey_count.py b/kyu_8/count_the_monkeys/monkey_count.py index c089aa86894..bf4467b021a 100644 --- a/kyu_8/count_the_monkeys/monkey_count.py +++ b/kyu_8/count_the_monkeys/monkey_count.py @@ -1,5 +1,6 @@ """ -Solution for -> Count the Monkeys! +Solution for -> Count the Monkeys!. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,6 +8,8 @@ def monkey_count(n: int) -> list: """ + Count monkeys. + You take your son to the forest to see the monkeys. You know that there are a certain number there (n), but your son is too young to just appreciate the full diff --git a/kyu_8/count_the_monkeys/test_monkey_count.py b/kyu_8/count_the_monkeys/test_monkey_count.py index 095047df308..24e7e002a84 100644 --- a/kyu_8/count_the_monkeys/test_monkey_count.py +++ b/kyu_8/count_the_monkeys/test_monkey_count.py @@ -1,5 +1,6 @@ """ -Test for -> Count the Monkeys! +Test for -> Count the Monkeys!. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -9,6 +10,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.count_the_monkeys.monkey_count \ import monkey_count @@ -33,13 +35,19 @@ name='Source/Kata') # pylint: enable=R0801 class MonkeyCountTestCase(unittest.TestCase): - """ - Testing monkey_count function - """ + """Testing monkey_count function.""" - def test_monkey_count(self): + @parameterized.expand([ + (1, [1]), + (5, [1, 2, 3, 4, 5]), + (3, [1, 2, 3]), + (9, [1, 2, 3, 4, 5, 6, 7, 8, 9]), + (10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), + (20, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20])]) + def test_monkey_count(self, n, expected): """ - Testing monkey_count function + Testing monkey_count function. You take your son to the forest to see the monkeys. You know that there are a certain number there (n), @@ -62,16 +70,7 @@ def test_monkey_count(self): '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 - with allure.step("Enter a number (int) and verify the output"): - test_data: tuple = ( - (1, [1]), - (5, [1, 2, 3, 4, 5]), - (3, [1, 2, 3]), - (9, [1, 2, 3, 4, 5, 6, 7, 8, 9]), - (10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), - (20, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20])) - - for n, expected in test_data: - print_log(n=n, expected=expected) - self.assertEqual(expected, monkey_count(n)) + with allure.step(f"Enter a number (int): {n} " + f"and verify the expected output: {expected}."): + print_log(n=n, expected=expected) + self.assertEqual(expected, monkey_count(n)) From 3ffa4e19888c40dea4b5284c66d4bee31aa5d08e Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:29:19 -0800 Subject: [PATCH 051/107] Counting sheep --- kyu_8/counting_sheep/__init__.py | 1 + kyu_8/counting_sheep/counting_sheep.py | 13 +++-- kyu_8/counting_sheep/test_counting_sheep.py | 56 ++++++++++++--------- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/kyu_8/counting_sheep/__init__.py b/kyu_8/counting_sheep/__init__.py index e69de29bb2d..b676058b62c 100644 --- a/kyu_8/counting_sheep/__init__.py +++ b/kyu_8/counting_sheep/__init__.py @@ -0,0 +1 @@ +"""Counting sheep.""" diff --git a/kyu_8/counting_sheep/counting_sheep.py b/kyu_8/counting_sheep/counting_sheep.py index be4c8583b89..8ade6f78b92 100644 --- a/kyu_8/counting_sheep/counting_sheep.py +++ b/kyu_8/counting_sheep/counting_sheep.py @@ -1,12 +1,15 @@ """ Solution for -> Counting sheep... + Created by Egor Kostan. GitHub: https://github.com/ikostan """ -def count_sheeps(array_of_sheeps: list) -> int: +def count_sheep(array_of_sheep: list) -> int: """ + Count sheep. + Consider an array of sheep where some sheep may be missing from their place. We need a function that counts the number of sheep @@ -14,8 +17,8 @@ def count_sheeps(array_of_sheeps: list) -> int: Hint: Don't forget to check for bad values like null/undefined - :param array_of_sheeps: - :return: + :param array_of_sheep: list + :return: int """ - return 0 if array_of_sheeps is None \ - else array_of_sheeps.count(True) + return 0 if array_of_sheep is None \ + else array_of_sheep.count(True) diff --git a/kyu_8/counting_sheep/test_counting_sheep.py b/kyu_8/counting_sheep/test_counting_sheep.py index 5b48b889a49..0f1c9eb47bd 100644 --- a/kyu_8/counting_sheep/test_counting_sheep.py +++ b/kyu_8/counting_sheep/test_counting_sheep.py @@ -1,5 +1,6 @@ """ Test for -> Counting sheep... + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -9,7 +10,7 @@ import unittest import allure from utils.log_func import print_log -from kyu_8.counting_sheep.counting_sheep import count_sheeps +from kyu_8.counting_sheep.counting_sheep import count_sheep # pylint: disable=R0801 @@ -26,13 +27,12 @@ name='Source/Kata') # pylint: enable=R0801 class CountingSheepTestCase(unittest.TestCase): - """ - Testing 'count_sheeps' function - """ + """Testing 'count_sheep' function.""" def test_counting_sheep(self): """ - Testing 'count_sheeps' function + Testing 'count_sheep' function. + Consider an array of sheep where some sheep may be missing from their place. We need a function that counts the @@ -42,12 +42,13 @@ def test_counting_sheep(self): """ # pylint: disable=R0801 allure.dynamic.title( - "Testing 'count_sheeps' function: positive flow") + "Testing 'count_sheep' function: positive flow") allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 @@ -60,13 +61,14 @@ def test_counting_sheep(self): expected: int = 17 print_log(list=lst, expected=expected) self.assertEqual(expected, - count_sheeps(lst), + count_sheep(lst), f"There are 17 sheep in total, " - f"not {count_sheeps(lst)}") + f"not {count_sheep(lst)}") def test_counting_sheep_bad_input(self): """ - Testing 'count_sheeps' function + Testing 'count_sheep' function, invalid values. + Hint: Don't forget to check for bad values like null/undefined :return: @@ -86,25 +88,27 @@ def test_counting_sheep_bad_input(self): expected: int = 0 print_log(list=lst, expected=expected) self.assertEqual(expected, - count_sheeps(lst), + count_sheep(lst), f"There are 0 sheep in total, " - f"not {count_sheeps(lst)}") + f"not {count_sheep(lst)}") def test_counting_sheep_empty_list(self): """ - Testing 'count_sheeps' function + Testing 'count_sheep' function, empty list. + Hint: Don't forget to check for bad values like empty list :return: """ # pylint: disable=R0801 allure.dynamic.title( - "Testing 'count_sheeps' function: empty list") + "Testing 'count_sheep' function: empty list") allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 @@ -112,25 +116,27 @@ def test_counting_sheep_empty_list(self): expected: int = 0 print_log(list=lst, expected=expected) self.assertEqual(expected, - count_sheeps(lst), + count_sheep(lst), f"There are 0 sheep in total, " - f"not {count_sheeps(lst)}") + f"not {count_sheep(lst)}") def test_counting_sheep_mixed_list(self): """ - Testing 'count_sheeps' function + Testing 'count_sheep' function, null value. + Hint: Don't forget to check for bad values like mixed list :return: """ # pylint: disable=R0801 allure.dynamic.title( - "Testing 'count_sheeps' function: mixed list") + "Testing 'count_sheep' function: mixed list") allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 @@ -138,6 +144,6 @@ def test_counting_sheep_mixed_list(self): expected: int = 1 print_log(list=lst, expected=expected) self.assertEqual(expected, - count_sheeps(lst), + count_sheep(lst), f"There are 0 sheep in total, " - f"not {count_sheeps(lst)}") + f"not {count_sheep(lst)}") From 2905ff43b8a23d848c11044efc3b400ad38abee6 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:34:18 -0800 Subject: [PATCH 052/107] Enumerable Magic #25 - Take the First N Elements. --- kyu_8/enumerable_magic_25/__init__.py | 1 + kyu_8/enumerable_magic_25/take.py | 7 +++- kyu_8/enumerable_magic_25/test_take.py | 52 +++++++++++--------------- 3 files changed, 27 insertions(+), 33 deletions(-) diff --git a/kyu_8/enumerable_magic_25/__init__.py b/kyu_8/enumerable_magic_25/__init__.py index e69de29bb2d..410c8d0558c 100644 --- a/kyu_8/enumerable_magic_25/__init__.py +++ b/kyu_8/enumerable_magic_25/__init__.py @@ -0,0 +1 @@ +"""Enumerable Magic #25 - Take the First N Elements.""" diff --git a/kyu_8/enumerable_magic_25/take.py b/kyu_8/enumerable_magic_25/take.py index 107e0bb3450..0512f533432 100644 --- a/kyu_8/enumerable_magic_25/take.py +++ b/kyu_8/enumerable_magic_25/take.py @@ -1,5 +1,6 @@ """ -Solution for -> Enumerable Magic #25 - Take the First N Elements +Solution for -> Enumerable Magic #25 - Take the First N Elements. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,8 +8,10 @@ def take(arr: list, n: int) -> list: """ + 'take' function. + Accepts a list/array and a number n, - and returns a list/array array of the + and returns a list/array of the first n elements from the list/array. :param arr: list diff --git a/kyu_8/enumerable_magic_25/test_take.py b/kyu_8/enumerable_magic_25/test_take.py index ab1cb2d98ba..97d7be1a043 100644 --- a/kyu_8/enumerable_magic_25/test_take.py +++ b/kyu_8/enumerable_magic_25/test_take.py @@ -1,5 +1,6 @@ """ -Test for -> Enumerable Magic #25 - Take the First N Elements +Test for -> Enumerable Magic #25 - Take the First N Elements. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.enumerable_magic_25.take import take @@ -25,13 +27,17 @@ name='Source/Kata') # pylint: enable=R0801 class TakeTestCase(unittest.TestCase): - """ - Testing take function - """ + """Testing 'take' function.""" - def test_take(self): + @parameterized.expand([ + ([0, 1, 2, 3, 5, 8, 13], 3, [0, 1, 2]), + ([51], 35, [51]), + ([], 3, []), + ([0, 1, 2, 3, 5, 8, 13], 0, [])]) + def test_take(self, arr, n, expected): """ - Testing the function with various test data + Testing the function with various test data. + :return: """ # pylint: disable=R0801 @@ -39,8 +45,9 @@ def test_take(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p>Create a method take that accepts a list/array and a" " number n, and returns a list/array array of the first " @@ -49,31 +56,14 @@ def test_take(self): "https://docs.python.org/3/library/stdtypes" ".html#sequence-types-list-tuple-range</p>") # pylint: enable=R0801 - test_data: tuple = ( - ([0, 1, 2, 3, 5, 8, 13], - 3, - [0, 1, 2]), - ([51], - 35, - [51]), - ([], - 3, - []), - ([0, 1, 2, 3, 5, 8, 13], - 0, - [])) - - for arr, n, expected in test_data: - actual_result = take(arr, n) - - with allure.step(f"Enter a list ({arr}) and verify the " - f"expected output ({expected}) " - f"vs actual result ({actual_result})"): + actual_result = take(arr, n) + with allure.step(f"Enter a list ({arr}) and verify the " + f"expected output ({expected}) " + f"vs actual result ({actual_result})"): - print_log(rr=arr, + print_log(rr=arr, n=n, expected=expected, result=actual_result) - self.assertEqual(expected, - actual_result) + self.assertEqual(expected, actual_result) From 625967ad9bdb6b67df91cd58bc283d471cd890cc Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:48:30 -0800 Subject: [PATCH 053/107] # Find the first non-consecutive number --- .../__init__.py | 1 + .../first_non_consecutive.py | 3 +- .../test_first_non_consecutive.py | 42 ++++++++++++------- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/kyu_8/find_the_first_non_consecutive_number/__init__.py b/kyu_8/find_the_first_non_consecutive_number/__init__.py index e69de29bb2d..5d551d5ef4e 100644 --- a/kyu_8/find_the_first_non_consecutive_number/__init__.py +++ b/kyu_8/find_the_first_non_consecutive_number/__init__.py @@ -0,0 +1 @@ +"""Find the first non-consecutive number.""" \ No newline at end of file diff --git a/kyu_8/find_the_first_non_consecutive_number/first_non_consecutive.py b/kyu_8/find_the_first_non_consecutive_number/first_non_consecutive.py index e88d5a1c966..0c21f38cd62 100644 --- a/kyu_8/find_the_first_non_consecutive_number/first_non_consecutive.py +++ b/kyu_8/find_the_first_non_consecutive_number/first_non_consecutive.py @@ -1,5 +1,6 @@ """ -Solution for -> Find the first non-consecutive number +Solution for -> Find the first non-consecutive number. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ diff --git a/kyu_8/find_the_first_non_consecutive_number/test_first_non_consecutive.py b/kyu_8/find_the_first_non_consecutive_number/test_first_non_consecutive.py index fe89221e5a2..ff9c7a69abb 100644 --- a/kyu_8/find_the_first_non_consecutive_number/test_first_non_consecutive.py +++ b/kyu_8/find_the_first_non_consecutive_number/test_first_non_consecutive.py @@ -1,5 +1,6 @@ """ -Test for -> Find the first non-consecutive number +Test for -> Find the first non-consecutive number. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -27,12 +28,12 @@ name='Source/Kata') # pylint: enable=R0801 class FirstNonConsecutiveTestCase(unittest.TestCase): - """ - Testing first_non_consecutive function - """ + """Testing first_non_consecutive function.""" def test_first_non_consecutive_none(self): """ + Testing first_non_consecutive function, non-consecutive numbers. + If the whole array is consecutive then return null or Nothing or None. :return: @@ -42,12 +43,13 @@ def test_first_non_consecutive_none(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 - with allure.step("Pass a list with no non consecutive numbers"): + with allure.step("Pass a list with non-consecutive numbers"): lst: list = [1, 2, 3, 4, 5, 6, 7, 8] expected: None = None @@ -62,7 +64,8 @@ def test_first_non_consecutive_none(self): def test_first_non_consecutive_large_list(self): """ - Large lists + Testing large lists. + :return: """ # pylint: disable=R0801 @@ -70,8 +73,9 @@ def test_first_non_consecutive_large_list(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 @@ -114,6 +118,8 @@ def test_first_non_consecutive_large_list(self): def test_first_non_consecutive_positive(self): """ + Test non-consecutive positive numbers. + If we have an array [1,2,3,4,6,7,8] then 1 then 2 then 3 then 4 are all consecutive but 6 is not, so that's the first non-consecutive number. @@ -124,8 +130,9 @@ def test_first_non_consecutive_positive(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 @@ -170,16 +177,19 @@ def test_first_non_consecutive_positive(self): def test_first_non_consecutive_negative(self): """ - non-consecutive is a negative number. + Test non-consecutive is a negative number. + :return: """ # pylint: disable=R0801 - allure.dynamic.title("Negative non consecutive number should be returned") + allure.dynamic.title( + "Negative non consecutive number should be returned") allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 From 7e6d0be998929659dbd5cdb2ac5deae6381babd3 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:57:05 -0800 Subject: [PATCH 054/107] Formatting decimal places #0 --- kyu_8/formatting_decimal_places_0/__init__.py | 1 + .../test_two_decimal_places.py | 46 +++++++++---------- .../two_decimal_places.py | 5 +- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/kyu_8/formatting_decimal_places_0/__init__.py b/kyu_8/formatting_decimal_places_0/__init__.py index e69de29bb2d..1ced7a92204 100644 --- a/kyu_8/formatting_decimal_places_0/__init__.py +++ b/kyu_8/formatting_decimal_places_0/__init__.py @@ -0,0 +1 @@ +"""Formatting decimal places #0.""" diff --git a/kyu_8/formatting_decimal_places_0/test_two_decimal_places.py b/kyu_8/formatting_decimal_places_0/test_two_decimal_places.py index d25a74b52da..057315550ba 100644 --- a/kyu_8/formatting_decimal_places_0/test_two_decimal_places.py +++ b/kyu_8/formatting_decimal_places_0/test_two_decimal_places.py @@ -1,5 +1,6 @@ """ -Test for -> Formatting decimal places #0 +Test for -> Formatting decimal places #0. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.formatting_decimal_places_0.two_decimal_places \ import two_decimal_places @@ -29,14 +31,21 @@ name='Source/Kata') # pylint: enable=R0801 class TwoDecimalPlacesTestCase(unittest.TestCase): - """ - Testing two_decimal_places function - """ + """Testing two_decimal_places function.""" - def test_two_decimal_places(self): + @parameterized.expand([ + (4.659725356, + 4.66, + "didn't work for 4.659725356"), + (173735326.3783732637948948, + 173735326.38, + "didn't work for 173735326.3783732637948948"), + (4.653725356, + 4.65, + "didn't work for 4.653725356")]) + def test_two_decimal_places(self, n, expected, msg): """ - Testing two_decimal_places function - with various test inputs. + Testing two_decimal_places function with various test inputs. Each number should be formatted that it is rounded to two decimal places. You don't @@ -50,25 +59,12 @@ def test_two_decimal_places(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 with allure.step("Pass a number and verify the output"): - data: tuple = ( - (4.659725356, - 4.66, - "didn't work for 4.659725356"), - (173735326.3783732637948948, - 173735326.38, - "didn't work for 173735326.3783732637948948"), - (4.653725356, - 4.65, - "didn't work for 4.653725356")) - - for n, expected, msg in data: - print_log(n=n, expected=expected) - self.assertEqual(expected, - two_decimal_places(n), - msg) + print_log(n=n, expected=expected) + self.assertEqual(expected, two_decimal_places(n), msg) diff --git a/kyu_8/formatting_decimal_places_0/two_decimal_places.py b/kyu_8/formatting_decimal_places_0/two_decimal_places.py index f6202d3bd6c..43822163c39 100644 --- a/kyu_8/formatting_decimal_places_0/two_decimal_places.py +++ b/kyu_8/formatting_decimal_places_0/two_decimal_places.py @@ -1,5 +1,6 @@ """ -Solution for -> Formatting decimal places #0 +Solution for -> Formatting decimal places #0. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,6 +8,8 @@ def two_decimal_places(n: float) -> float: """ + Convert a number into decimal. + Each number should be formatted that it is rounded to two decimal places. You don't need to check whether the input is a valid From 477fc50ae9a52a8b553cf3c8066fbba3649b8743 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 03:05:30 -0800 Subject: [PATCH 055/107] Grasshopper --- .../grasshopper_check_for_factor/__init__.py | 1 + .../check_for_factor.py | 6 +- .../test_check_for_factor.py | 68 ++++++++----------- 3 files changed, 32 insertions(+), 43 deletions(-) diff --git a/kyu_8/grasshopper_check_for_factor/__init__.py b/kyu_8/grasshopper_check_for_factor/__init__.py index e69de29bb2d..e8573f8e858 100644 --- a/kyu_8/grasshopper_check_for_factor/__init__.py +++ b/kyu_8/grasshopper_check_for_factor/__init__.py @@ -0,0 +1 @@ +"""Grasshopper.""" diff --git a/kyu_8/grasshopper_check_for_factor/check_for_factor.py b/kyu_8/grasshopper_check_for_factor/check_for_factor.py index 9073809a97c..b22755abbf9 100644 --- a/kyu_8/grasshopper_check_for_factor/check_for_factor.py +++ b/kyu_8/grasshopper_check_for_factor/check_for_factor.py @@ -1,5 +1,6 @@ """ -Solution for -> Grasshopper - Check for factor +Solution for -> Grasshopper - Check for factor. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,8 +8,7 @@ def check_for_factor(base: int, factor: int) -> bool: """ - This function should test if the - factor is a factor of base. + Check if the factor is a factor of base. Factors are numbers you can multiply together to get another number. diff --git a/kyu_8/grasshopper_check_for_factor/test_check_for_factor.py b/kyu_8/grasshopper_check_for_factor/test_check_for_factor.py index 52ace47678c..6b8597bb418 100644 --- a/kyu_8/grasshopper_check_for_factor/test_check_for_factor.py +++ b/kyu_8/grasshopper_check_for_factor/test_check_for_factor.py @@ -1,5 +1,6 @@ """ -Test for -> Grasshopper - Check for factor +Test for -> Grasshopper - Check for factor. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.grasshopper_check_for_factor.check_for_factor \ import check_for_factor @@ -29,11 +31,14 @@ name='Source/Kata') # pylint: disable=R0801 class CheckForFactorTestCase(unittest.TestCase): - """ - Testing check_for_factor function. - """ - - def test_check_for_factor_true(self): + """Testing check_for_factor function.""" + + @parameterized.expand([ + (10, 2, True), + (63, 7, True), + (2450, 5, True), + (24612, 3, True)]) + def test_check_for_factor_true(self, base, factor, expected): """ Testing check_for_factor function. @@ -49,28 +54,22 @@ def test_check_for_factor_true(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 with allure.step("Return true if it is a factor"): - data: tuple = ( - (10, 2, True), - (63, 7, True), - (2450, 5, True), - (24612, 3, True)) - - for base, factor, expected in data: - - print_log(base=base, - factor=factor, - expected=expected) - - self.assertEqual(expected, - check_for_factor(base, factor)) - - def test_check_for_factor_false(self): + print_log(base=base, factor=factor, expected=expected) + self.assertEqual(expected, check_for_factor(base, factor)) + + @parameterized.expand([ + (9, 2, False), + (653, 7, False), + (2453, 5, False), + (24617, 3, False)]) + def test_check_for_factor_false(self, base, factor, expected): """ Testing check_for_factor function. @@ -86,23 +85,12 @@ def test_check_for_factor_false(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 with allure.step("Return false if it is not a factor"): - data: tuple = ( - (9, 2, False), - (653, 7, False), - (2453, 5, False), - (24617, 3, False)) - - for base, factor, expected in data: - - print_log(base=base, - factor=factor, - expected=expected) - - self.assertEqual(expected, - check_for_factor(base, factor)) + print_log(base=base, factor=factor, expected=expected) + self.assertEqual(expected, check_for_factor(base, factor)) From a0dd26595fb3708c13dd945ada1b8b379c804314 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 03:10:40 -0800 Subject: [PATCH 056/107] # Grasshopper - Messi goals function --- .../__init__.py | 1 + .../messi_goals_function.py | 5 ++++- .../test_messi_goals_function.py | 19 +++++++++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/kyu_8/grasshopper_messi_goals_function/__init__.py b/kyu_8/grasshopper_messi_goals_function/__init__.py index e69de29bb2d..b041eb78383 100644 --- a/kyu_8/grasshopper_messi_goals_function/__init__.py +++ b/kyu_8/grasshopper_messi_goals_function/__init__.py @@ -0,0 +1 @@ +"""Grasshopper - Messi goals function.""" diff --git a/kyu_8/grasshopper_messi_goals_function/messi_goals_function.py b/kyu_8/grasshopper_messi_goals_function/messi_goals_function.py index 439037ca19d..8891f8333af 100644 --- a/kyu_8/grasshopper_messi_goals_function/messi_goals_function.py +++ b/kyu_8/grasshopper_messi_goals_function/messi_goals_function.py @@ -1,5 +1,6 @@ """ -Solution for -> Messi goals function +Solution for -> Messi goals function. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,6 +8,8 @@ def goals(la_liga: int, copa_delrey: int, champions_league: int) -> int: """ + Goals function. + The function returns Messi's total number of goals in all three leagues: - LaLiga diff --git a/kyu_8/grasshopper_messi_goals_function/test_messi_goals_function.py b/kyu_8/grasshopper_messi_goals_function/test_messi_goals_function.py index a69045f494d..faad955dd3d 100644 --- a/kyu_8/grasshopper_messi_goals_function/test_messi_goals_function.py +++ b/kyu_8/grasshopper_messi_goals_function/test_messi_goals_function.py @@ -1,5 +1,6 @@ """ -Test for -> Messi goals function +Test for -> Messi goals function. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -26,14 +27,15 @@ name='Source/Kata') # pylint: enable=R0801 class GoalsTestCase(unittest.TestCase): - """ - Testing goals function - """ + """Testing goals function.""" def test_goals(self): """ - Verify that the function returns Messi's - total number of goals in all three leagues. + Testing 'goals' function with various test data. + + Verify that the function returns Messi's total + number of goals in all three leagues. + :return: """ # pylint: disable=R0801 @@ -41,8 +43,9 @@ def test_goals(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 From 19e631f47f1242af41c35ddb86b3854f2f5538ae Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 03:17:14 -0800 Subject: [PATCH 057/107] Personalized greeting --- .../__init__.py | 1 + .../grasshopper_personalized_message.py | 7 ++++--- .../test_grasshopper_personalized_message.py | 21 ++++++++++--------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/kyu_8/grasshopper_personalized_message/__init__.py b/kyu_8/grasshopper_personalized_message/__init__.py index e69de29bb2d..491c5af033c 100644 --- a/kyu_8/grasshopper_personalized_message/__init__.py +++ b/kyu_8/grasshopper_personalized_message/__init__.py @@ -0,0 +1 @@ +"""Grasshopper - Personalized Message.""" diff --git a/kyu_8/grasshopper_personalized_message/grasshopper_personalized_message.py b/kyu_8/grasshopper_personalized_message/grasshopper_personalized_message.py index 32e43086b0f..2ffbc91f663 100644 --- a/kyu_8/grasshopper_personalized_message/grasshopper_personalized_message.py +++ b/kyu_8/grasshopper_personalized_message/grasshopper_personalized_message.py @@ -1,5 +1,6 @@ """ -Solution for -> Personalized greeting +Solution for -> Personalized greeting. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,9 +8,9 @@ def greet(name: str, owner: str) -> str: """ - Function that gives a personalized greeting. - This function takes two parameters: name and owner. + Return a personalized greeting. + This function takes two parameters: name and owner. :param name: str :param owner: str :return: diff --git a/kyu_8/grasshopper_personalized_message/test_grasshopper_personalized_message.py b/kyu_8/grasshopper_personalized_message/test_grasshopper_personalized_message.py index c7ebc2db024..a6ebc4e21a2 100644 --- a/kyu_8/grasshopper_personalized_message/test_grasshopper_personalized_message.py +++ b/kyu_8/grasshopper_personalized_message/test_grasshopper_personalized_message.py @@ -1,5 +1,6 @@ """ -Test for -> Personalized greeting +Test for -> Personalized greeting. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -23,18 +24,17 @@ @allure.tag('FUNDAMENTALS', 'CONDITIONAL STATEMENTS', 'CONTROL FLOW') -@allure.link(url='https://www.codewars.com/kata/5772da22b89313a4d50012f7', - name='Source/Kata') +@allure.link( + url='https://www.codewars.com/kata/5772da22b89313a4d50012f7', + name='Source/Kata') # pylint: enable=R0801 class GreetTestCase(unittest.TestCase): - """ - Testing greet function - """ + """Testing greet function.""" def test_greet(self): """ - Use conditionals to to verify that greet - function returns the proper message. + Conditionals tests to verify that greet function returns the proper message. + :return: """ # pylint: disable=R0801 @@ -43,8 +43,9 @@ def test_greet(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 From 097e59ca172e3f260ed980d435c05910ce3c72a2 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 03:21:58 -0800 Subject: [PATCH 058/107] Grasshopper - Summation --- kyu_8/grasshopper_summation/__init__.py | 1 + kyu_8/grasshopper_summation/summation.py | 11 ++--- kyu_8/grasshopper_summation/test_summation.py | 42 +++++++++---------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/kyu_8/grasshopper_summation/__init__.py b/kyu_8/grasshopper_summation/__init__.py index e69de29bb2d..1afc95ba7c6 100644 --- a/kyu_8/grasshopper_summation/__init__.py +++ b/kyu_8/grasshopper_summation/__init__.py @@ -0,0 +1 @@ +"""Grasshopper - Summation.""" diff --git a/kyu_8/grasshopper_summation/summation.py b/kyu_8/grasshopper_summation/summation.py index 244c2dd01d4..b0d76af18ef 100644 --- a/kyu_8/grasshopper_summation/summation.py +++ b/kyu_8/grasshopper_summation/summation.py @@ -1,5 +1,6 @@ """ -Solution for -> Grasshopper - Summation +Solution for -> Grasshopper - Summation. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,12 +8,12 @@ def summation(num: int) -> int: """ - A program that finds the summation of every - number from 1 to num. + Find the summation of every number from 1 to num. + The number will always be a positive integer greater than 0. - :param num: - :return: + :param num: int + :return: int """ result: int = 0 for i in range(1, num + 1): diff --git a/kyu_8/grasshopper_summation/test_summation.py b/kyu_8/grasshopper_summation/test_summation.py index 888f66a3f9b..9463ac9c165 100644 --- a/kyu_8/grasshopper_summation/test_summation.py +++ b/kyu_8/grasshopper_summation/test_summation.py @@ -1,5 +1,6 @@ """ -Test for -> Grasshopper - Summation +Test for -> Grasshopper - Summation. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.grasshopper_summation.summation import summation @@ -28,14 +30,18 @@ name='Source/Kata') # pylint: enable=R0801 class SummationTestCase(unittest.TestCase): - """ - Testing summation function - """ + """Testing summation function.""" - def test_summation(self): + @parameterized.expand([ + (1, 1), + (8, 36), + (22, 253), + (100, 5050), + (213, 22791)]) + def test_summation(self, num, expected): """ - Testing summation function - with various test inputs + Testing summation function with various test inputs. + :return: """ # pylint: disable=R0801 @@ -43,21 +49,13 @@ def test_summation(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p></p>") # pylint: enable=R0801 - with allure.step("Enter number and verify the output"): - test_data: tuple = ( - (1, 1), - (8, 36), - (22, 253), - (100, 5050), - (213, 22791)) - - for d in test_data: - num: int = d[0] - expected: int = d[1] - print_log(num=num, expected=expected) - self.assertEqual(summation(num), expected) + with allure.step(f"Enter a number: {num} " + f"and verify the expected output: {expected}."): + print_log(num=num, expected=expected) + self.assertEqual(summation(num), expected) From 033aef3a017ca38e50a6aa283bb860d0a6f3ea0f Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 03:39:31 -0800 Subject: [PATCH 059/107] # Greek Sort --- kyu_8/greek_sort/__init__.py | 1 + kyu_8/greek_sort/evaluator.py | 8 +++- kyu_8/greek_sort/greek_comparator.py | 7 ++- kyu_8/greek_sort/test_greek_comparator.py | 54 +++++++++++------------ 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/kyu_8/greek_sort/__init__.py b/kyu_8/greek_sort/__init__.py index e69de29bb2d..c7b87d9e076 100644 --- a/kyu_8/greek_sort/__init__.py +++ b/kyu_8/greek_sort/__init__.py @@ -0,0 +1 @@ +"""Greek Sort.""" diff --git a/kyu_8/greek_sort/evaluator.py b/kyu_8/greek_sort/evaluator.py index ed4a7f7f3f2..87ee1fa7f28 100644 --- a/kyu_8/greek_sort/evaluator.py +++ b/kyu_8/greek_sort/evaluator.py @@ -1,11 +1,15 @@ """ -Evaluates the expression +Evaluator function for -> Greek Sort. + +Created by Egor Kostan. +GitHub: https://github.com/ikostan """ def evaluator(result: int, expected: str) -> bool: """ - Evaluator + Evaluator function. + :param result: int :param expected: str :return: bool diff --git a/kyu_8/greek_sort/greek_comparator.py b/kyu_8/greek_sort/greek_comparator.py index c3c6cb9665c..3be8ac276f6 100644 --- a/kyu_8/greek_sort/greek_comparator.py +++ b/kyu_8/greek_sort/greek_comparator.py @@ -1,5 +1,6 @@ """ -Solution for -> Greek Sort +Solution for -> Greek Sort. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -15,10 +16,12 @@ def greek_comparator(lhs: str, rhs: str) -> int: """ + Greek comparator function. + A custom comparison function of two arguments (iterable elements) which should return a negative, zero or positive number depending on whether the first argument is considered smaller than, equal to, - or larger than the second argument + or larger than the second argument. :param lhs: str :param rhs: str :return: int diff --git a/kyu_8/greek_sort/test_greek_comparator.py b/kyu_8/greek_sort/test_greek_comparator.py index e2f70debdf6..5213b0fc477 100644 --- a/kyu_8/greek_sort/test_greek_comparator.py +++ b/kyu_8/greek_sort/test_greek_comparator.py @@ -1,5 +1,6 @@ """ -Test for -> Greek Sort +Test for -> Greek Sort. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from kyu_8.greek_sort.greek_comparator import greek_comparator from kyu_8.greek_sort.evaluator import evaluator from utils.log_func import print_log @@ -24,14 +26,16 @@ url='https://www.codewars.com/kata/56bc1acf66a2abc891000561', name='Source/Kata') class GreekComparatorTestCase(unittest.TestCase): - """ - Testing greek_comparator function - """ + """Testing greek_comparator function.""" - def test_greek_comparator(self): + @parameterized.expand([ + ('alpha', 'beta', '< 0'), + ('psi', 'psi', '== 0'), + ('upsilon', 'rho', '> 0')]) + def test_greek_comparator(self, lhs, rhs, expected): """ - Testing greek_comparator function - with various test inputs + Testing greek_comparator function with various test inputs. + :return: """ # pylint: disable=R0801 @@ -39,8 +43,9 @@ def test_greek_comparator(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p>A custom comparison function of two arguments (iterable" " elements) which should return a negative, zero or positive" @@ -48,26 +53,17 @@ def test_greek_comparator(self): " smaller than, equal to, or larger than the second argument" "</p>") # pylint: enable=R0801 - test_data: tuple = ( - ('alpha', 'beta', '< 0'), - ('psi', 'psi', '== 0'), - ('upsilon', 'rho', '> 0')) - - for d in test_data: - lhs, rhs, expected = d[0], d[1], d[2] - result = greek_comparator(lhs, rhs) - - with allure.step(f"Enter test inputs({lhs}, {rhs}) " - f"and assert expected ({expected}) " - f"vs actual result ({result})"): + result = greek_comparator(lhs, rhs) + with allure.step(f"Enter test inputs({lhs}, {rhs}) " + f"and assert expected ({expected}) " + f"vs actual result ({result})"): - expression: str = f'{result} {expected}' + expression: str = f'{result} {expected}' - print_log(lhs=lhs, - rhs=rhs, - expected=expected, - result=result, - expression=expression) + print_log(lhs=lhs, + rhs=rhs, + expected=expected, + result=result, + expression=expression) - self.assertTrue(evaluator(result=result, - expected=expected)) + self.assertTrue(evaluator(result=result, expected=expected)) From 718d2c7afdba14c85f0c871e919df4d68c93cbd1 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 03:40:41 -0800 Subject: [PATCH 060/107] Update __init__.py --- kyu_8/find_the_first_non_consecutive_number/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/find_the_first_non_consecutive_number/__init__.py b/kyu_8/find_the_first_non_consecutive_number/__init__.py index 5d551d5ef4e..97e0a5e54d6 100644 --- a/kyu_8/find_the_first_non_consecutive_number/__init__.py +++ b/kyu_8/find_the_first_non_consecutive_number/__init__.py @@ -1 +1 @@ -"""Find the first non-consecutive number.""" \ No newline at end of file +"""Find the first non-consecutive number.""" From 07fa235d218c50bfdc5678a05860e231bae1b9c1 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 04:24:37 -0800 Subject: [PATCH 061/107] closest_elevator --- kyu_8/README.md | 79 ++++++++++--------- kyu_8/closest_elevator/README.md | 30 +++++++ kyu_8/closest_elevator/__init__.py | 1 + kyu_8/closest_elevator/closest_elevator.py | 24 ++++++ .../closest_elevator/test_closest_elevator.py | 62 +++++++++++++++ 5 files changed, 157 insertions(+), 39 deletions(-) create mode 100644 kyu_8/closest_elevator/README.md create mode 100644 kyu_8/closest_elevator/__init__.py create mode 100644 kyu_8/closest_elevator/closest_elevator.py create mode 100644 kyu_8/closest_elevator/test_closest_elevator.py diff --git a/kyu_8/README.md b/kyu_8/README.md index 31f86dbec1c..739f1ecf7ce 100644 --- a/kyu_8/README.md +++ b/kyu_8/README.md @@ -15,44 +15,45 @@ harder the kata the faster you advance. ### List of Completed Kata (Python 3) <!-- markdownlint-disable MD013 --> -| No. | Puzzle/Kata Name | Solution / GitHub Link | -|-----|-------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------| -|1 |[altERnaTIng cAsE <=> ALTerNAtiNG CaSe](https://www.codewars.com/kata/56efc695740d30f963000557) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/alternating_case) | -|2 |[Check the exam](https://www.codewars.com/kata/5a3dd29055519e23ec000074) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/check_the_exam) | -|3 |[Counting sheep...](https://www.codewars.com/kata/54edbc7200b811e956000556) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/counting_sheep) | -|4 |[Find the first non-consecutive number](https://www.codewars.com/kata/58f8a3a27a5c28d92e000144) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/find_the_first_non_consecutive_number)| -|5 |[Grasshopper - Check for Factor](https://www.codewars.com/kata/55cbc3586671f6aa070000fb) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/grasshopper_check_for_factor) | -|6 |[Grasshopper - Messi goals function](https://www.codewars.com/kata/55f73be6e12baaa5900000d4) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/grasshopper_messi_goals_function) | -|7 |[Grasshopper - Personalized Message](https://www.codewars.com/kata/5772da22b89313a4d50012f7) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/grasshopper_personalized_message) | -|8 |[Grasshopper - Summation](https://www.codewars.com/kata/55d24f55d7dd296eb9000030) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/grasshopper_summation) | -|9 |[Is it a palindrome](https://www.codewars.com/kata/57a1fd2ce298a731b20006a4) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/is_it_a_palindrome) | -|10 |[Is your period late](https://www.codewars.com/kata/578a8a01e9fd1549e50001f1) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/is_your_period_late) | -|11 |[Keep Hydrated!](https://www.codewars.com/kata/582cb0224e56e068d800003c) |[Solution](https://github.com/ikostan/codewars/blob/master/kyu_8/keep_hydrated/README.md) | -|12 |[Logical calculator](https://www.codewars.com/kata/57096af70dad013aa200007b) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/logical_calculator) | -|13 |[MakeUpperCase](https://www.codewars.com/kata/57a0556c7cb1f31ab3000ad7) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/make_upper_case) | -|14 |[Multiply](https://www.codewars.com/kata/50654ddff44f800200000004) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/multiply) | -|15 |[My head is at the wrong end](https://www.codewars.com/kata/56f699cd9400f5b7d8000b55) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/my_head_is_at_the_wrong_end) | -|16 |[Remove First and Last Character](https://www.codewars.com/kata/56bc28ad5bdaeb48760009b0) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/remove_first_and_last_character) | -|17 |[Remove String Spaces](https://www.codewars.com/kata/57eae20f5500ad98e50002c5) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/remove_string_spaces) | -|18 |[Reversed Strings](https://www.codewars.com/kata/5168bb5dfe9a00b126000018) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/reversed_strings) | -|19 |[L1: Set Alarm](https://www.codewars.com/kata/568dcc3c7f12767a62000038) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/set_alarm) | -|20 |[Surface Area and Volume of a Box](https://www.codewars.com/kata/565f5825379664a26b00007c) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/surface_area_and_volume_of_box) | -|21 |[Swap Values](https://www.codewars.com/kata/5388f0e00b24c5635e000fc6) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/swap_values) | -|22 |[Grasshopper - Terminal game move function](https://www.codewars.com/kata/563a631f7cbbc236cf0000c2) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/terminal_game_move_function) | -|23 |[Third Angle of a Triangle](https://www.codewars.com/kata/5a023c426975981341000014) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/third_angle_of_triangle) | -|24 |[Well of Ideas - Easy Version](https://www.codewars.com/kata/57f222ce69e09c3630000212) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/well_of_ideas_easy_version) | -|25 |[Will there be enough space](https://www.codewars.com/kata/5875b200d520904a04000003) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/will_there_be_enough_space) | -|26 |[A wolf in sheep's clothing](https://www.codewars.com/kata/5c8bfa44b9d1192e1ebd3d15) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/wolf_in_sheep_clothing) | -|27 |[Formatting decimal places #0](https://www.codewars.com/kata/5641a03210e973055a00000d) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/formatting_decimal_places_0) | -|28 |[Convert a string to an array](https://www.codewars.com/kata/57e76bc428d6fbc2d500036d) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/convert_string_to_an_array) | -|29 |[The Feast of Many Beasts](https://www.codewars.com/kata/5aa736a455f906981800360d) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/the_feast_of_many_beasts) | -|30 |[Count the Monkeys!](https://www.codewars.com/kata/count-the-monkeys) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/count_the_monkeys) | -|31 |[Keep up the hoop](https://www.codewars.com/kata/55cb632c1a5d7b3ad0000145) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/keep_up_the_hoop) | -|32 |[Enumerable Magic #25 - Take the First N Elements](https://www.codewars.com/kata/545afd0761aa4c3055001386)|[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/enumerable_magic_25) | -|33 |[Will you make it?](https://www.codewars.com/kata/5861d28f124b35723e00005e) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/will_you_make_it) | -|34 |[Century From Year](https://www.codewars.com/kata/5a3fe3dde1ce0e8ed6000097) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/century_from_year) | -|35 |[Holiday VI - Shark Pontoon](https://www.codewars.com/kata/57e921d8b36340f1fd000059) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/holiday_vi_shark_pontoon) | -|36 |[My head is at the wrong end!](https://www.codewars.com/kata/56f699cd9400f5b7d8000b55) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/my_head_is_at_the_wrong_end) | -|37 |[Greek Sort](https://www.codewars.com/kata/56bc1acf66a2abc891000561) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/greek_sort) | +| No. | Puzzle/Kata Name | Solution / GitHub Link | +|-----|:--------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------:| +| 1 | [altERnaTIng cAsE <=> ALTerNAtiNG CaSe](https://www.codewars.com/kata/56efc695740d30f963000557) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/alternating_case) | +| 2 | [Check the exam](https://www.codewars.com/kata/5a3dd29055519e23ec000074) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/check_the_exam) | +| 3 | [Counting sheep...](https://www.codewars.com/kata/54edbc7200b811e956000556) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/counting_sheep) | +| 4 | [Find the first non-consecutive number](https://www.codewars.com/kata/58f8a3a27a5c28d92e000144) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/find_the_first_non_consecutive_number) | +| 5 | [Grasshopper - Check for Factor](https://www.codewars.com/kata/55cbc3586671f6aa070000fb) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/grasshopper_check_for_factor) | +| 6 | [Grasshopper - Messi goals function](https://www.codewars.com/kata/55f73be6e12baaa5900000d4) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/grasshopper_messi_goals_function) | +| 7 | [Grasshopper - Personalized Message](https://www.codewars.com/kata/5772da22b89313a4d50012f7) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/grasshopper_personalized_message) | +| 8 | [Grasshopper - Summation](https://www.codewars.com/kata/55d24f55d7dd296eb9000030) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/grasshopper_summation) | +| 9 | [Is it a palindrome](https://www.codewars.com/kata/57a1fd2ce298a731b20006a4) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/is_it_a_palindrome) | +| 10 | [Is your period late](https://www.codewars.com/kata/578a8a01e9fd1549e50001f1) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/is_your_period_late) | +| 11 | [Keep Hydrated!](https://www.codewars.com/kata/582cb0224e56e068d800003c) | [Solution](https://github.com/ikostan/codewars/blob/master/kyu_8/keep_hydrated/README.md) | +| 12 | [Logical calculator](https://www.codewars.com/kata/57096af70dad013aa200007b) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/logical_calculator) | +| 13 | [MakeUpperCase](https://www.codewars.com/kata/57a0556c7cb1f31ab3000ad7) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/make_upper_case) | +| 14 | [Multiply](https://www.codewars.com/kata/50654ddff44f800200000004) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/multiply) | +| 15 | [My head is at the wrong end](https://www.codewars.com/kata/56f699cd9400f5b7d8000b55) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/my_head_is_at_the_wrong_end) | +| 16 | [Remove First and Last Character](https://www.codewars.com/kata/56bc28ad5bdaeb48760009b0) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/remove_first_and_last_character) | +| 17 | [Remove String Spaces](https://www.codewars.com/kata/57eae20f5500ad98e50002c5) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/remove_string_spaces) | +| 18 | [Reversed Strings](https://www.codewars.com/kata/5168bb5dfe9a00b126000018) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/reversed_strings) | +| 19 | [L1: Set Alarm](https://www.codewars.com/kata/568dcc3c7f12767a62000038) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/set_alarm) | +| 20 | [Surface Area and Volume of a Box](https://www.codewars.com/kata/565f5825379664a26b00007c) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/surface_area_and_volume_of_box) | +| 21 | [Swap Values](https://www.codewars.com/kata/5388f0e00b24c5635e000fc6) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/swap_values) | +| 22 | [Grasshopper - Terminal game move function](https://www.codewars.com/kata/563a631f7cbbc236cf0000c2) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/terminal_game_move_function) | +| 23 | [Third Angle of a Triangle](https://www.codewars.com/kata/5a023c426975981341000014) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/third_angle_of_triangle) | +| 24 | [Well of Ideas - Easy Version](https://www.codewars.com/kata/57f222ce69e09c3630000212) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/well_of_ideas_easy_version) | +| 25 | [Will there be enough space](https://www.codewars.com/kata/5875b200d520904a04000003) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/will_there_be_enough_space) | +| 26 | [A wolf in sheep's clothing](https://www.codewars.com/kata/5c8bfa44b9d1192e1ebd3d15) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/wolf_in_sheep_clothing) | +| 27 | [Formatting decimal places #0](https://www.codewars.com/kata/5641a03210e973055a00000d) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/formatting_decimal_places_0) | +| 28 | [Convert a string to an array](https://www.codewars.com/kata/57e76bc428d6fbc2d500036d) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/convert_string_to_an_array) | +| 29 | [The Feast of Many Beasts](https://www.codewars.com/kata/5aa736a455f906981800360d) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/the_feast_of_many_beasts) | +| 30 | [Count the Monkeys!](https://www.codewars.com/kata/count-the-monkeys) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/count_the_monkeys) | +| 31 | [Keep up the hoop](https://www.codewars.com/kata/55cb632c1a5d7b3ad0000145) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/keep_up_the_hoop) | +| 32 | [Enumerable Magic #25 - Take the First N Elements](https://www.codewars.com/kata/545afd0761aa4c3055001386) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/enumerable_magic_25) | +| 33 | [Will you make it?](https://www.codewars.com/kata/5861d28f124b35723e00005e) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/will_you_make_it) | +| 34 | [Century From Year](https://www.codewars.com/kata/5a3fe3dde1ce0e8ed6000097) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/century_from_year) | +| 35 | [Holiday VI - Shark Pontoon](https://www.codewars.com/kata/57e921d8b36340f1fd000059) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/holiday_vi_shark_pontoon) | +| 36 | [My head is at the wrong end!](https://www.codewars.com/kata/56f699cd9400f5b7d8000b55) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/my_head_is_at_the_wrong_end) | +| 37 | [Greek Sort](https://www.codewars.com/kata/56bc1acf66a2abc891000561) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/greek_sort) | +| 38 | [Closest elevator](https://www.codewars.com/kata/5c374b346a5d0f77af500a5a) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_8/closest_elevator) | <!-- markdownlint-enable MD013 --> [Source](https://www.codewars.com/about) diff --git a/kyu_8/closest_elevator/README.md b/kyu_8/closest_elevator/README.md new file mode 100644 index 00000000000..51e1fa33e81 --- /dev/null +++ b/kyu_8/closest_elevator/README.md @@ -0,0 +1,30 @@ +# Closest elevator + +## Description + +Given 2 elevators (named "left" and "right") in a building with 3 floors +(numbered 0 to 2), write a function accepting 3 arguments (in order): + +`left` - The current floor of the left elevator +`right` - The current floor of the right elevator +`call` - The floor that called an elevator + +It should return the name of the elevator closest to the called floor ("left"/"right"). + +In the case where both elevators are equally distant from the called floor, +choose the elevator to the right. + +You can assume that the inputs will always be valid integers between 0-2. + +## Examples + +``` +left right call result + 0 1 0 "left" + 0 1 1 "right" + 0 1 2 "right" + 0 0 0 "right" + 0 2 1 "right" +``` + +[Source](https://www.codewars.com/kata/5c374b346a5d0f77af500a5a) \ No newline at end of file diff --git a/kyu_8/closest_elevator/__init__.py b/kyu_8/closest_elevator/__init__.py new file mode 100644 index 00000000000..7eaf34320c3 --- /dev/null +++ b/kyu_8/closest_elevator/__init__.py @@ -0,0 +1 @@ +"""Closest elevator.""" diff --git a/kyu_8/closest_elevator/closest_elevator.py b/kyu_8/closest_elevator/closest_elevator.py new file mode 100644 index 00000000000..d7a14647c98 --- /dev/null +++ b/kyu_8/closest_elevator/closest_elevator.py @@ -0,0 +1,24 @@ +""" +Solution for -> Closest elevator. + +Created by Egor Kostan. +GitHub: https://github.com/ikostan +""" + +def elevator(left: int, right: int, call: int) -> str: + """ + Return closest elevator number. + + :param left: int + :param right: int + :param call: int + :return: str + """ + if right == left == call: + return 'right' + + if left == call or abs(call - left) < abs(call - right): + return 'left' + + return 'right' + diff --git a/kyu_8/closest_elevator/test_closest_elevator.py b/kyu_8/closest_elevator/test_closest_elevator.py new file mode 100644 index 00000000000..fb6e3bc0873 --- /dev/null +++ b/kyu_8/closest_elevator/test_closest_elevator.py @@ -0,0 +1,62 @@ +""" +Test for -> Closest elevator. + +Created by Egor Kostan. +GitHub: https://github.com/ikostan +""" + +# Algorithms + +import unittest +import allure +from parameterized import parameterized +from utils.log_func import print_log +from kyu_8.closest_elevator.closest_elevator import elevator + + +# pylint: disable=R0801 +@allure.epic('8 kyu') +@allure.parent_suite('Beginner') +@allure.suite("Data Structures") +@allure.sub_suite("Unit Tests") +@allure.feature("Lists") +@allure.story('Closest elevator') +@allure.tag('FUNDAMENTALS', + 'ALGORITHMS') +@allure.link( + url='https://www.codewars.com/kata/5c374b346a5d0f77af500a5a', + name='Source/Kata') +# pylint: enable=R0801 +class ClosestElevatorTestCase(unittest.TestCase): + """Test elevator function.""" + + @parameterized.expand([ + ((0, 1, 0), "left"), + ((0, 1, 1), "right"), + ((0, 1, 2), "right"), + ((0, 0, 0), "right"), + ((0, 2, 1), "right")]) + def test_elevator_basic(self, elevators, expected): + """ + Testing 'elevator' function with various test data. + + :return: + """ + # pylint: disable=R0801 + allure.dynamic.title("Testing elevator function") + allure.dynamic.severity(allure.severity_level.NORMAL) + allure.dynamic.description_html( + '<h3>Codewars badge:</h3>' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' + '<h3>Test Description:</h3>' + "<p></p>") + # pylint: enable=R0801 + with allure.step(f"Enter test data: {elevators} " + f"and verify the expected output: {expected}."): + left, right, call = elevators + result: str = elevator(left, right, call) + print_log(expected=expected, left=left, right=right, call=call) + message: str = f'elevators: {elevators}, result: {result}, expected: {expected}' + self.assertEqual(expected, result, msg=message) From aa02db4e8d1a5a634aacb28eb35102d3328caf04 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 04:26:24 -0800 Subject: [PATCH 062/107] Update closest_elevator.py Using config file /home/runner/work/codewars/codewars/.pylintrc ************* Module kyu_8.closest_elevator.closest_elevator kyu_8/closest_elevator/closest_elevator.py:24:0: C0305: Trailing newlines (trailing-newlines) --- kyu_8/closest_elevator/closest_elevator.py | 1 - 1 file changed, 1 deletion(-) diff --git a/kyu_8/closest_elevator/closest_elevator.py b/kyu_8/closest_elevator/closest_elevator.py index d7a14647c98..3a04743db19 100644 --- a/kyu_8/closest_elevator/closest_elevator.py +++ b/kyu_8/closest_elevator/closest_elevator.py @@ -21,4 +21,3 @@ def elevator(left: int, right: int, call: int) -> str: return 'left' return 'right' - From 2e5bc5ab72b314e268a2377e277bfd2f1f93bc8e Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 04:27:44 -0800 Subject: [PATCH 063/107] Update requirements.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issues to fix by upgrading dependencies: Upgrade jinja2@3.1.4 to jinja2@3.1.5 to fix ✗ Template Injection (new) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-JINJA2-8548181] in jinja2@3.1.4 introduced by jinja2@3.1.4 and 2 other path(s) ✗ Improper Neutralization (new) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-JINJA2-8548987] in jinja2@3.1.4 introduced by jinja2@3.1.4 and 2 other path(s) --- requirements.txt | Bin 2808 -> 2808 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/requirements.txt b/requirements.txt index f29b41e793f444adba31aee864001ba5cceb0d46..0aa523925287de66ba0e7bede64343af62553236 100644 GIT binary patch delta 14 Vcmew%`a^UB6APp1W@eVJYyc?~1iSzM delta 14 Vcmew%`a^UB6APosW@eVJYyc?^1iJtL From 8e5724aa2a5e2349dd40ac7bdcf474f61b9d4402 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 04:33:30 -0800 Subject: [PATCH 064/107] Update requirements.txt --- requirements.txt | Bin 2808 -> 2808 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/requirements.txt b/requirements.txt index f29b41e793f444adba31aee864001ba5cceb0d46..0aa523925287de66ba0e7bede64343af62553236 100644 GIT binary patch delta 14 Vcmew%`a^UB6APp1W@eVJYyc?~1iSzM delta 14 Vcmew%`a^UB6APosW@eVJYyc?^1iJtL From 07c185194fafa24406c8848740e1489f52982dce Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 04:50:24 -0800 Subject: [PATCH 065/107] # Holiday VI - Shark Pontoon --- kyu_8/holiday_vi_shark_pontoon/__init__.py | 1 + kyu_8/holiday_vi_shark_pontoon/shark.py | 6 ++++-- kyu_8/holiday_vi_shark_pontoon/test_shark.py | 16 +++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/kyu_8/holiday_vi_shark_pontoon/__init__.py b/kyu_8/holiday_vi_shark_pontoon/__init__.py index e69de29bb2d..d2ec6b21e8c 100644 --- a/kyu_8/holiday_vi_shark_pontoon/__init__.py +++ b/kyu_8/holiday_vi_shark_pontoon/__init__.py @@ -0,0 +1 @@ +"""Holiday VI - Shark Pontoon.""" diff --git a/kyu_8/holiday_vi_shark_pontoon/shark.py b/kyu_8/holiday_vi_shark_pontoon/shark.py index c1b97b07c7b..2decb2b5b55 100644 --- a/kyu_8/holiday_vi_shark_pontoon/shark.py +++ b/kyu_8/holiday_vi_shark_pontoon/shark.py @@ -1,5 +1,6 @@ """ -Solution for -> Holiday VI - Shark Pontoon +Solution for -> Holiday VI - Shark Pontoon. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -11,6 +12,8 @@ def shark(pontoon_distance, shark_speed, dolphin) -> str: """ + Shark function. + You are given 5 variables: sharkDistance = distance the shark needs to cover to eat you in metres, sharkSpeed = how fast it can move in metres/second, pontoonDistance = how far you need @@ -19,7 +22,6 @@ def shark(pontoon_distance, the swimming speed of the shark as the dolphin will attack it. If you make it, return "Alive!", if not, return "Shark Bait!". - :param pontoon_distance: :param shark_distance: :param you_speed: diff --git a/kyu_8/holiday_vi_shark_pontoon/test_shark.py b/kyu_8/holiday_vi_shark_pontoon/test_shark.py index 712bc97e21c..350946571f7 100644 --- a/kyu_8/holiday_vi_shark_pontoon/test_shark.py +++ b/kyu_8/holiday_vi_shark_pontoon/test_shark.py @@ -1,5 +1,6 @@ """ -Test for -> Holiday VI - Shark Pontoon +Test for -> Holiday VI - Shark Pontoon. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -26,13 +27,12 @@ url='https://www.codewars.com/kata/57e921d8b36340f1fd000059', name='Source/Kata') class SharkTestCase(unittest.TestCase): - """ - Testing shark function - """ + """Testing shark function.""" def test_shark_alive_1(self): """ - Testing shark function -> positive + Testing shark function -> positive #1. + :return: """ # pylint: disable=R0801 @@ -66,7 +66,8 @@ def test_shark_alive_1(self): def test_shark_alive_2(self): """ - Testing shark function -> positive + Testing shark function -> positive #2. + :return: """ # pylint: disable=R0801 @@ -100,7 +101,8 @@ def test_shark_alive_2(self): def test_shark_bait(self): """ - Testing shark function -> negative + Testing shark function -> negative. + :return: """ # pylint: disable=R0801 From d20c550085305dd2e1d6070c75e98a2c28de8f3d Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 05:00:15 -0800 Subject: [PATCH 066/107] kyu_8 docs --- docs/kyu_8/kyu_8.closest_elevator.rst | 32 +++++++++++++++++++++++++++ docs/kyu_8/kyu_8.greek_sort.rst | 10 ++++----- docs/kyu_8/kyu_8.rst | 2 +- 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 docs/kyu_8/kyu_8.closest_elevator.rst diff --git a/docs/kyu_8/kyu_8.closest_elevator.rst b/docs/kyu_8/kyu_8.closest_elevator.rst new file mode 100644 index 00000000000..87d8946ffa8 --- /dev/null +++ b/docs/kyu_8/kyu_8.closest_elevator.rst @@ -0,0 +1,32 @@ +kyu\_8.closest\_elevator package +================================ + +Submodules +---------- + +kyu\_8.closest\_elevator.closest\_elevator module +------------------------------------------------- + +.. automodule:: kyu_8.closest_elevator.closest_elevator + :members: + :undoc-members: + :show-inheritance: + :private-members: + +kyu\_8.closest\_elevator.test\_closest\_elevator module +------------------------------------------------------- + +.. automodule:: kyu_8.closest_elevator.test_closest_elevator + :members: + :undoc-members: + :show-inheritance: + :private-members: + +Module contents +--------------- + +.. automodule:: kyu_8.closest_elevator + :members: + :undoc-members: + :show-inheritance: + :private-members: diff --git a/docs/kyu_8/kyu_8.greek_sort.rst b/docs/kyu_8/kyu_8.greek_sort.rst index 8d34ffa8d2d..640c357c1c5 100644 --- a/docs/kyu_8/kyu_8.greek_sort.rst +++ b/docs/kyu_8/kyu_8.greek_sort.rst @@ -4,19 +4,19 @@ kyu\_8.greek\_sort package Submodules ---------- -kyu\_8.greek\_sort.greek\_comparator module -------------------------------------------- +kyu\_8.greek\_sort.evaluator module +----------------------------------- -.. automodule:: kyu_8.greek_sort.greek_comparator +.. automodule:: kyu_8.greek_sort.evaluator :members: :undoc-members: :show-inheritance: :private-members: -kyu\_8.greek\_sort.evaluator module +kyu\_8.greek\_sort.greek\_comparator module ------------------------------------------- -.. automodule:: kyu_8.greek_sort.evaluator +.. automodule:: kyu_8.greek_sort.greek_comparator :members: :undoc-members: :show-inheritance: diff --git a/docs/kyu_8/kyu_8.rst b/docs/kyu_8/kyu_8.rst index 4ebf3f9ed13..de518e18f07 100644 --- a/docs/kyu_8/kyu_8.rst +++ b/docs/kyu_8/kyu_8.rst @@ -7,10 +7,10 @@ Subpackages .. toctree:: :maxdepth: 4 - kyu_8.readme kyu_8.alternating_case kyu_8.century_from_year kyu_8.check_the_exam + kyu_8.closest_elevator kyu_8.convert_string_to_an_array kyu_8.count_the_monkeys kyu_8.counting_sheep From 6d62247f082be9c2e769394bb02f3f0f6ecb4c99 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 05:07:38 -0800 Subject: [PATCH 067/107] # Is it a palindrome --- kyu_8/is_it_a_palindrome/__init__.py | 1 + kyu_8/is_it_a_palindrome/is_palindrome.py | 7 ++- .../is_it_a_palindrome/test_is_palindrome.py | 52 +++++++++---------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/kyu_8/is_it_a_palindrome/__init__.py b/kyu_8/is_it_a_palindrome/__init__.py index e69de29bb2d..d96511f544b 100644 --- a/kyu_8/is_it_a_palindrome/__init__.py +++ b/kyu_8/is_it_a_palindrome/__init__.py @@ -0,0 +1 @@ +"""Is it a palindrome.""" diff --git a/kyu_8/is_it_a_palindrome/is_palindrome.py b/kyu_8/is_it_a_palindrome/is_palindrome.py index 0e0afcb961b..88ba9606d18 100644 --- a/kyu_8/is_it_a_palindrome/is_palindrome.py +++ b/kyu_8/is_it_a_palindrome/is_palindrome.py @@ -1,5 +1,6 @@ """ -Solution for -> Is it a palindrome? +Solution for -> Is it a palindrome?. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,8 +8,10 @@ def is_palindrome(s: str) -> bool: """ + Palindrome testing function. + Write function isPalindrome that checks if - a given string (case insensitive) is a palindrome. + a given string (case-insensitive) is a palindrome. :param s: str :return: bool """ diff --git a/kyu_8/is_it_a_palindrome/test_is_palindrome.py b/kyu_8/is_it_a_palindrome/test_is_palindrome.py index 71fea953daf..5d28ea002fe 100644 --- a/kyu_8/is_it_a_palindrome/test_is_palindrome.py +++ b/kyu_8/is_it_a_palindrome/test_is_palindrome.py @@ -1,5 +1,6 @@ """ -Test for -> Is it a palindrome? +Test for -> Is it a palindrome?. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.is_it_a_palindrome.is_palindrome import is_palindrome @@ -25,18 +27,28 @@ name='Source/Kata') # pylint: enable=R0801 class IsPalindromeTestCase(unittest.TestCase): - """ - Testing is_palindrome function - """ + """Testing is_palindrome function.""" - def test_is_palindrome(self): + @parameterized.expand([ + ('a', True), + ('aba', True), + ('Abba', True), + ('malam', True), + ('walter', False), + ('kodok', True), + ('Kasue', False), + ('NdjXglGnYGKhQtuAcxNWFwVRZZDMrFmiOPMZsvr', False), + ('XqmUTaAmrrYitgNwkCwaWdFYsEhfIeOohViba', False), + ('ZtItThFBUPCSCbtcUfDwXzyajhRIWioUHpVzN', False), + ('XqNeuBjbshHwqjoUNGHhVRolqxWRRWYYbN', False)]) + def test_is_palindrome(self, string, expected): """ - Testing is_palindrome function - with various test inputs + Testing is_palindrome function with various test inputs. The function should check if a - given string (case insensitive) + given string (case-insensitive) is a palindrome. + :return: """ # pylint: disable=R0801 allure.dynamic.title("Testing is_palindrome function") @@ -46,22 +58,10 @@ def test_is_palindrome(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") - - with allure.step("Enter test string and verify the output"): - test_data: tuple = ( - ('a', True), - ('aba', True), - ('Abba', True), - ('malam', True), - ('walter', False), - ('kodok', True), - ('Kasue', False), - ('NdjXglGnYGKhQtuAcxNWFwVRZZDMrFmiOPMZsvr', False), - ('XqmUTaAmrrYitgNwkCwaWdFYsEhfIeOohViba', False), - ('ZtItThFBUPCSCbtcUfDwXzyajhRIWioUHpVzN', False), - ('XqNeuBjbshHwqjoUNGHhVRolqxWRRWYYbN', False)) + "<p>isPalindrome that checks if a given string " + "(case insensitive) is a palindrome.</p>") - for string, expected in test_data: - print_log(string=string, expected=expected) - self.assertEqual(expected, is_palindrome(string)) + with allure.step(f"Enter test string: {string} " + f"and verify expected output: {expected}."): + print_log(string=string, expected=expected) + self.assertEqual(expected, is_palindrome(string)) From 3e56bf32baffef0cdcfd3a711c90c7b211387eec Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 05:11:24 -0800 Subject: [PATCH 068/107] # MakeUpperCase --- kyu_8/make_upper_case/__init__.py | 1 + kyu_8/make_upper_case/make_upper_case.py | 6 ++++-- kyu_8/make_upper_case/test_make_upper_case.py | 18 ++++++++++-------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/kyu_8/make_upper_case/__init__.py b/kyu_8/make_upper_case/__init__.py index e69de29bb2d..f1eedc12b18 100644 --- a/kyu_8/make_upper_case/__init__.py +++ b/kyu_8/make_upper_case/__init__.py @@ -0,0 +1 @@ +"""MakeUpperCase.""" diff --git a/kyu_8/make_upper_case/make_upper_case.py b/kyu_8/make_upper_case/make_upper_case.py index bdf110549ba..29dc55c42db 100644 --- a/kyu_8/make_upper_case/make_upper_case.py +++ b/kyu_8/make_upper_case/make_upper_case.py @@ -1,5 +1,6 @@ """ -Solution for -> MakeUpperCase +Solution for -> MakeUpperCase. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,7 +8,8 @@ def make_upper_case(s: str) -> str: """ - Function that make UpperCase. + Function that convert to UpperCase. + :param s: str :return: str """ diff --git a/kyu_8/make_upper_case/test_make_upper_case.py b/kyu_8/make_upper_case/test_make_upper_case.py index 8b4e69f812f..e91e66ce0e9 100644 --- a/kyu_8/make_upper_case/test_make_upper_case.py +++ b/kyu_8/make_upper_case/test_make_upper_case.py @@ -1,5 +1,6 @@ """ -Test for -> MakeUpperCase +Test for -> MakeUpperCase. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -25,13 +26,12 @@ name='Source/Kata') # pylint: enable=R0801 class MakeUpperCaseTestCase(unittest.TestCase): - """ - Testing make_upper_case function - """ + """Testing make_upper_case function.""" def test_make_upper_case(self): """ - Sample Tests for make_upper_case function + Sample Tests for make_upper_case function. + :return: """ # pylint: disable=R0801 @@ -39,10 +39,12 @@ def test_make_upper_case(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>Make sure 'make_upper_case' function convert " + "strings to UpperCase.</p>") # pylint: enable=R0801 with allure.step("Pass lower case string and verify the output"): string: str = "hello" From 58114cdabc5912d8c574f3f4e038ce08305b979e Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:18:47 -0800 Subject: [PATCH 069/107] multiply --- kyu_8/multiply/__init__.py | 1 + kyu_8/multiply/multiply.py | 15 ++++++--------- kyu_8/multiply/test_multiply.py | 11 +++++------ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/kyu_8/multiply/__init__.py b/kyu_8/multiply/__init__.py index e69de29bb2d..b14368ed6b5 100644 --- a/kyu_8/multiply/__init__.py +++ b/kyu_8/multiply/__init__.py @@ -0,0 +1 @@ +"""Multiply.""" diff --git a/kyu_8/multiply/multiply.py b/kyu_8/multiply/multiply.py index 2ee767034da..d229bbee71a 100644 --- a/kyu_8/multiply/multiply.py +++ b/kyu_8/multiply/multiply.py @@ -1,9 +1,5 @@ """ -Multiply Problem Description -The code does not execute properly. Try to figure out why. - -def multiply(a, b): - a * b +Solution for -> Multiply problem. Created by Egor Kostan. GitHub: https://github.com/ikostan @@ -12,9 +8,10 @@ def multiply(a, b): def multiply(a: int, b: int) -> int: """ - Multiply two numbers and return the result - :param a: - :param b: - :return: + Multiply two numbers and return the result. + + :param a: int + :param b: int + :return: int """ return a * b diff --git a/kyu_8/multiply/test_multiply.py b/kyu_8/multiply/test_multiply.py index ad3ad6eacd0..b88e820f674 100644 --- a/kyu_8/multiply/test_multiply.py +++ b/kyu_8/multiply/test_multiply.py @@ -1,5 +1,6 @@ """ -Test for -> Multiply +Test for -> Multiply. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -26,14 +27,12 @@ name='Source/Kata') # pylint: enable-msg=R0801 class MultiplyTestCase(unittest.TestCase): - """ - Testing multiply function - """ + """Testing multiply function.""" def test_multiply(self): """ - Verify that multiply function - returns correct result + Verify that multiply function returns correct results. + :return: """ # pylint: disable-msg=R0801 From aec5c893dbc8dfa3a7b2c7a16c8da37368f5ae52 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:25:38 -0800 Subject: [PATCH 070/107] My head is at the wrong end. --- kyu_8/my_head_is_at_the_wrong_end/__init__.py | 1 + .../fix_the_meerkat.py | 11 ++--- .../test_fix_the_meerkat.py | 49 ++++++++++--------- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/kyu_8/my_head_is_at_the_wrong_end/__init__.py b/kyu_8/my_head_is_at_the_wrong_end/__init__.py index e69de29bb2d..3e664a34072 100644 --- a/kyu_8/my_head_is_at_the_wrong_end/__init__.py +++ b/kyu_8/my_head_is_at_the_wrong_end/__init__.py @@ -0,0 +1 @@ +"""My head is at the wrong end.""" diff --git a/kyu_8/my_head_is_at_the_wrong_end/fix_the_meerkat.py b/kyu_8/my_head_is_at_the_wrong_end/fix_the_meerkat.py index e8712249bf6..2fd21c771ca 100644 --- a/kyu_8/my_head_is_at_the_wrong_end/fix_the_meerkat.py +++ b/kyu_8/my_head_is_at_the_wrong_end/fix_the_meerkat.py @@ -1,5 +1,6 @@ """ -Solution for -> My head is at the wrong end! +Solution for -> My head is at the wrong end!. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,11 +8,9 @@ def fix_the_meerkat(arr: list) -> list: """ - You will be given an array which will have - three values (tail, body, head). - It is your job to re-arrange the array so - that the animal is the right way round - (head, body, tail). + 'fix_the_meerkat' function. + + Reversing a List in Python. :param arr: :return: """ diff --git a/kyu_8/my_head_is_at_the_wrong_end/test_fix_the_meerkat.py b/kyu_8/my_head_is_at_the_wrong_end/test_fix_the_meerkat.py index 66331140cb1..92fedecf622 100644 --- a/kyu_8/my_head_is_at_the_wrong_end/test_fix_the_meerkat.py +++ b/kyu_8/my_head_is_at_the_wrong_end/test_fix_the_meerkat.py @@ -1,5 +1,6 @@ """ -Test for -> My head is at the wrong end! +Test for -> My head is at the wrong end!. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.my_head_is_at_the_wrong_end.fix_the_meerkat \ import fix_the_meerkat @@ -30,13 +32,24 @@ # pylint: enable=R0801 # @pytest.mark.skip(reason="The solution is not ready") class FixTheMeerkatTestCase(unittest.TestCase): - """ - Testing fix_the_meerkat function - """ + """Testing fix_the_meerkat function.""" - def test_fix_the_meerkat(self): + @parameterized.expand([ + (["tail", "body", "head"], ["head", "body", "tail"]), + (["tails", "body", "heads"], ["heads", "body", "tails"]), + (["bottom", "middle", "top"], ["top", "middle", "bottom"]), + (["lower legs", "torso", "upper legs"], + ["upper legs", "torso", "lower legs"]), + (["ground", "rainbow", "sky"], ["sky", "rainbow", "ground"])]) + def test_fix_the_meerkat(self, arr, expected): """ - Testing fix_the_meerkat function with various test data + Testing fix_the_meerkat function with various test data. + + You will be given an array which will have + three values (tail, body, head). + It is your job to re-arrange the array so + that the animal is the right way round + (head, body, tail). :return: """ # pylint: disable=R0801 @@ -54,21 +67,9 @@ def test_fix_the_meerkat(self): "so that the animal is the right way round (head, body, tail)." "</p>") # pylint: disable=R0801 - test_data: tuple = ( - (["tail", "body", "head"], ["head", "body", "tail"]), - (["tails", "body", "heads"], ["heads", "body", "tails"]), - (["bottom", "middle", "top"], ["top", "middle", "bottom"]), - (["lower legs", "torso", "upper legs"], - ["upper legs", "torso", "lower legs"]), - (["ground", "rainbow", "sky"], ["sky", "rainbow", "ground"])) - - for data in test_data: - arr: list = data[0] - expected: list = data[1] - result: list = fix_the_meerkat(arr) - - with allure.step(f"Enter test data: {arr} " - f"and assert actual result: {result} " - f"vs expected: {expected}"): - print_log(arr=arr, result=result, expected=expected) - self.assertEqual(expected, result) + result: list = fix_the_meerkat(arr) + with allure.step(f"Enter test data: {arr} " + f"and assert actual result: {result} " + f"vs expected: {expected}"): + print_log(arr=arr, result=result, expected=expected) + self.assertEqual(expected, result) From 175679b2a68d63f5f3503a3c6858f86c1c73f6c3 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:29:22 -0800 Subject: [PATCH 071/107] Remove First and Last Character --- kyu_8/remove_first_and_last_character/__init__.py | 1 + .../remove_first_and_last_character/remove_char.py | 10 ++++------ .../test_remove_char.py | 13 ++++++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/kyu_8/remove_first_and_last_character/__init__.py b/kyu_8/remove_first_and_last_character/__init__.py index e69de29bb2d..d4dad132afd 100644 --- a/kyu_8/remove_first_and_last_character/__init__.py +++ b/kyu_8/remove_first_and_last_character/__init__.py @@ -0,0 +1 @@ +"""Remove First and Last Character.""" diff --git a/kyu_8/remove_first_and_last_character/remove_char.py b/kyu_8/remove_first_and_last_character/remove_char.py index 305ad603678..4f9f7de5c68 100644 --- a/kyu_8/remove_first_and_last_character/remove_char.py +++ b/kyu_8/remove_first_and_last_character/remove_char.py @@ -1,5 +1,6 @@ """ -Solution for -> Remove First and Last Character +Solution for -> Remove First and Last Character. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,13 +8,10 @@ def remove_char(s: str) -> str: """ - A function that removes the first and - last characters of a string. + Remove the first and last characters of a string. You're given one parameter, the original string. - - You don't have to worry with strings - with less than two characters. + You don't have to worry with strings with less than two characters. :param s: str :return: str """ diff --git a/kyu_8/remove_first_and_last_character/test_remove_char.py b/kyu_8/remove_first_and_last_character/test_remove_char.py index 104e80bb659..660a6480b51 100644 --- a/kyu_8/remove_first_and_last_character/test_remove_char.py +++ b/kyu_8/remove_first_and_last_character/test_remove_char.py @@ -1,5 +1,6 @@ """ -Test for -> Remove First and Last Character +Test for -> Remove First and Last Character. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -28,15 +29,13 @@ name='Source/Kata') # pylint: enable=R0801 class RemoveCharTestCase(unittest.TestCase): - """ - Testing remove_char function - """ + """Testing remove_char function.""" def test_remove_char(self): """ - Test that 'remove_char' function - removes the first and - last characters of a string. + Test 'remove_char' function. + + Should remove the first and last characters of a string. :return: """ # pylint: disable=R0801 From ec31847763b5bbc73922177cd0332c1a78704694 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:33:50 -0800 Subject: [PATCH 072/107] Remove String Spaces. --- kyu_8/remove_string_spaces/__init__.py | 1 + kyu_8/remove_string_spaces/remove_string_spaces.py | 7 ++++--- .../remove_string_spaces/test_remove_string_spaces.py | 11 +++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/kyu_8/remove_string_spaces/__init__.py b/kyu_8/remove_string_spaces/__init__.py index e69de29bb2d..9539c9e46bb 100644 --- a/kyu_8/remove_string_spaces/__init__.py +++ b/kyu_8/remove_string_spaces/__init__.py @@ -0,0 +1 @@ +"""Remove String Spaces.""" diff --git a/kyu_8/remove_string_spaces/remove_string_spaces.py b/kyu_8/remove_string_spaces/remove_string_spaces.py index 38d0fcd0605..0711227dd0d 100644 --- a/kyu_8/remove_string_spaces/remove_string_spaces.py +++ b/kyu_8/remove_string_spaces/remove_string_spaces.py @@ -1,5 +1,6 @@ """ -Solution for -> Remove String Spaces +Solution for -> Remove String Spaces. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,8 +8,8 @@ def no_space(x: str) -> str: """ - Remove the spaces from the string, - then return the resultant string. + Remove the spaces from the string. + :param x: str :return: str """ diff --git a/kyu_8/remove_string_spaces/test_remove_string_spaces.py b/kyu_8/remove_string_spaces/test_remove_string_spaces.py index a2f9bbe5b8b..08a9ab566fc 100644 --- a/kyu_8/remove_string_spaces/test_remove_string_spaces.py +++ b/kyu_8/remove_string_spaces/test_remove_string_spaces.py @@ -1,5 +1,6 @@ """ -Test for -> Remove String Spaces +Test for -> Remove String Spaces. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -28,14 +29,12 @@ name='Source/Kata') # pylint: enable-msg=R0801 class NoSpaceTestCase(unittest.TestCase): - """ - Testing no_space function - """ + """Testing no_space function.""" def test_something(self): """ - Test that no_space function removes the spaces - from the string, then return the resultant string. + Test that no_space function with various test dara. + :return: """ # pylint: disable-msg=R0801 From f72d3f3fb94a7f3b78f46bea1cc002d699c6c668 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:36:26 -0800 Subject: [PATCH 073/107] Update kyu_8.rst checking consistency... /home/docs/checkouts/readthedocs.org/user_builds/codewars/checkouts/573/docs/kyu_8/kyu_8.readme.rst: WARNING: document isn't included in any toctree --- docs/kyu_8/kyu_8.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/kyu_8/kyu_8.rst b/docs/kyu_8/kyu_8.rst index de518e18f07..a144d283b9c 100644 --- a/docs/kyu_8/kyu_8.rst +++ b/docs/kyu_8/kyu_8.rst @@ -7,6 +7,7 @@ Subpackages .. toctree:: :maxdepth: 4 + kyu_8.readme kyu_8.alternating_case kyu_8.century_from_year kyu_8.check_the_exam From 8ea0a8cd3859adb15da1e4d722b39fd6c106ad69 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:42:00 -0800 Subject: [PATCH 074/107] Reversed Strings. --- kyu_8/reversed_strings/__init__.py | 1 + kyu_8/reversed_strings/reversed_strings.py | 6 ++++-- kyu_8/reversed_strings/test_reversed_strings.py | 16 +++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/kyu_8/reversed_strings/__init__.py b/kyu_8/reversed_strings/__init__.py index e69de29bb2d..0dd0ef57568 100644 --- a/kyu_8/reversed_strings/__init__.py +++ b/kyu_8/reversed_strings/__init__.py @@ -0,0 +1 @@ +"""Reversed Strings.""" diff --git a/kyu_8/reversed_strings/reversed_strings.py b/kyu_8/reversed_strings/reversed_strings.py index ae23a18de99..76c8a9ca868 100644 --- a/kyu_8/reversed_strings/reversed_strings.py +++ b/kyu_8/reversed_strings/reversed_strings.py @@ -1,5 +1,6 @@ """ -Solution for -> Reversed Strings +Solution for -> Reversed Strings. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,7 +8,8 @@ def solution(string: str) -> str: """ - reverses the string value passed into it + Reverse the string value. + :param string: str :return: str """ diff --git a/kyu_8/reversed_strings/test_reversed_strings.py b/kyu_8/reversed_strings/test_reversed_strings.py index 53188413bf7..14414a52021 100644 --- a/kyu_8/reversed_strings/test_reversed_strings.py +++ b/kyu_8/reversed_strings/test_reversed_strings.py @@ -1,5 +1,6 @@ """ -Test for -> Reversed Strings +Test for -> Reversed Strings. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -26,13 +27,12 @@ name='Source/Kata') # pylint: enable=R0801 class ReversedStringsTestCase(unittest.TestCase): - """ - Testing the solution for 'Reversed Strings' problem - """ + """Testing the solution for 'Reversed Strings' problem.""" def test_reversed_strings_empty(self): """ - Test with empty string + Test with empty string. + :return: """ # pylint: disable=R0801 @@ -53,7 +53,8 @@ def test_reversed_strings_empty(self): def test_reversed_strings_one_char(self): """ - Test with one char only + Test with one char only. + :return: """ # pylint: disable=R0801 @@ -74,7 +75,8 @@ def test_reversed_strings_one_char(self): def test_reversed_strings(self): """ - Test with regular string + Test with regular string. + :return: """ # pylint: disable=R0801 From ba6be03e55f96f17e269903ccd2279d0a3536fc2 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:49:43 -0800 Subject: [PATCH 075/107] L1: Set Alarm --- kyu_8/set_alarm/__init__.py | 1 + kyu_8/set_alarm/set_alarm.py | 16 ++------ kyu_8/set_alarm/test_set_alarm.py | 62 +++++++++++++++++-------------- 3 files changed, 39 insertions(+), 40 deletions(-) diff --git a/kyu_8/set_alarm/__init__.py b/kyu_8/set_alarm/__init__.py index e69de29bb2d..0c0881410bf 100644 --- a/kyu_8/set_alarm/__init__.py +++ b/kyu_8/set_alarm/__init__.py @@ -0,0 +1 @@ +"""L1: Set Alarm.""" diff --git a/kyu_8/set_alarm/set_alarm.py b/kyu_8/set_alarm/set_alarm.py index 176c42c2862..45df87cc92e 100644 --- a/kyu_8/set_alarm/set_alarm.py +++ b/kyu_8/set_alarm/set_alarm.py @@ -1,5 +1,6 @@ """ -Test for -> L1: Set Alarm +Test for -> L1: Set Alarm. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,28 +8,19 @@ def set_alarm(employed: bool, vacation: bool) -> bool: """ + 'set_alarm' function. + A function named setAlarm which receives two parameters. The first parameter, employed, is true whenever you are employed and the second parameter, vacation is true whenever you are on vacation. - The function should return true if you are employed and - not on vacation (because these are the circumstances under - which you need to set an alarm). It should return false - otherwise. - Examples: - - setAlarm(true, true) -> false - setAlarm(false, true) -> false - setAlarm(false, false) -> false - setAlarm(true, false) -> true :param employed: bool :param vacation: bool :return: bool """ - if employed and not vacation: return True return False diff --git a/kyu_8/set_alarm/test_set_alarm.py b/kyu_8/set_alarm/test_set_alarm.py index c5767adfa0a..8343922b702 100644 --- a/kyu_8/set_alarm/test_set_alarm.py +++ b/kyu_8/set_alarm/test_set_alarm.py @@ -1,5 +1,6 @@ """ -Test for -> L1: Set Alarm +Test for -> L1: Set Alarm. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.set_alarm.set_alarm import set_alarm @@ -30,7 +32,20 @@ class SetAlarmTestCase(unittest.TestCase): Testing set_alarm function """ - def test_set_alarm(self): + @parameterized.expand([ + ((True, True), + False, + "Fails when input is True, True"), + ((False, True), + False, + "Fails when input is False, True"), + ((False, False), + False, + "Fails when input is False, False"), + ((True, False), + True, + "Fails when input is True, False")]) + def test_set_alarm(self, test_input, expected, msg): """ Testing set_alarm function with various test inputs. @@ -55,31 +70,22 @@ def test_set_alarm(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>" + "The function should return true if you are employed and " + "not on vacation (because these are the circumstances under " + "which you need to set an alarm). It should return false " + "otherwise." + '</p>' + '<p>' + 'Examples:' + '<br>' + 'setAlarm(true, true) -> false<br>' + 'setAlarm(false, true) -> false<br>' + 'setAlarm(false, false) -> false<br>' + 'setAlarm(true, false) -> true<br>' + "</p>") # pylint: enable=R0801 with allure.step("Enter test data and verify the output"): - test_data: tuple = ( - ((True, True), - False, - "Fails when input is True, True"), - ((False, True), - False, - "Fails when input is False, True"), - ((False, False), - False, - "Fails when input is False, False"), - ((True, False), - True, - "Fails when input is True, False")) - - for test_input, expected, msg in test_data: - employed: bool = test_input[0] - vacation: bool = test_input[1] - - print_log(employed=employed, - vacation=vacation, - expected=expected) - - self.assertEqual(expected, - set_alarm(employed, vacation), - msg) + employed, vacation = test_input + print_log(employed=employed, vacation=vacation, expected=expected) + self.assertEqual(expected, set_alarm(employed, vacation), msg) From 07a08499afe696fba2edc5a2ee56d85ae7fd79dc Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:52:56 -0800 Subject: [PATCH 076/107] Surface Area and Volume of a Box. --- kyu_8/surface_area_and_volume_of_box/__init__.py | 1 + kyu_8/surface_area_and_volume_of_box/get_size.py | 7 ++++--- kyu_8/surface_area_and_volume_of_box/test_get_size.py | 10 +++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/kyu_8/surface_area_and_volume_of_box/__init__.py b/kyu_8/surface_area_and_volume_of_box/__init__.py index e69de29bb2d..58f15b59258 100644 --- a/kyu_8/surface_area_and_volume_of_box/__init__.py +++ b/kyu_8/surface_area_and_volume_of_box/__init__.py @@ -0,0 +1 @@ +"""Surface Area and Volume of a Box.""" diff --git a/kyu_8/surface_area_and_volume_of_box/get_size.py b/kyu_8/surface_area_and_volume_of_box/get_size.py index 33f8159f569..7361384429a 100644 --- a/kyu_8/surface_area_and_volume_of_box/get_size.py +++ b/kyu_8/surface_area_and_volume_of_box/get_size.py @@ -1,5 +1,6 @@ """ -Solution for -> Surface Area and Volume of a Box +Solution for -> Surface Area and Volume of a Box. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,8 +8,8 @@ def get_size(w: int, h: int, d: int) -> list: """ - Write a function that returns the total surface - area and volume of a box as an array: [area, volume] + Return the total surface area and volume of a box as an array. + :param w: :param h: :param d: diff --git a/kyu_8/surface_area_and_volume_of_box/test_get_size.py b/kyu_8/surface_area_and_volume_of_box/test_get_size.py index 90d3dc07ff7..b914d568173 100644 --- a/kyu_8/surface_area_and_volume_of_box/test_get_size.py +++ b/kyu_8/surface_area_and_volume_of_box/test_get_size.py @@ -1,5 +1,6 @@ """ -Test for -> Surface Area and Volume of a Box +Test for -> Surface Area and Volume of a Box. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -29,13 +30,12 @@ name='Source/Kata') # pylint: enable=R0801 class GetSizeTestCase(unittest.TestCase): - """ - Testing get_size function - """ + """Testing get_size function.""" def test_get_size(self): """ - Testing get_size function with various inputs + Testing get_size function with various inputs. + :return: """ # pylint: disable=R0801 From 738530bb8bfb1b1a4180edf005dfe9baa9f1171e Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:55:32 -0800 Subject: [PATCH 077/107] Swap Values. --- kyu_8/swap_values/__init__.py | 1 + kyu_8/swap_values/swap_values.py | 6 ++++-- kyu_8/swap_values/test_swap_values.py | 12 ++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/kyu_8/swap_values/__init__.py b/kyu_8/swap_values/__init__.py index e69de29bb2d..b650c89caf8 100644 --- a/kyu_8/swap_values/__init__.py +++ b/kyu_8/swap_values/__init__.py @@ -0,0 +1 @@ +"""Swap Values.""" diff --git a/kyu_8/swap_values/swap_values.py b/kyu_8/swap_values/swap_values.py index 270bfe2619d..72c7d990dd2 100644 --- a/kyu_8/swap_values/swap_values.py +++ b/kyu_8/swap_values/swap_values.py @@ -1,5 +1,6 @@ """ -Solution for -> Swap Values +Solution for -> Swap Values. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,7 +8,8 @@ def swap_values(args: list) -> None: """ - Swap values + Swap values. + :param args: :return: """ diff --git a/kyu_8/swap_values/test_swap_values.py b/kyu_8/swap_values/test_swap_values.py index 76cb92557c9..8a9b5ebded0 100644 --- a/kyu_8/swap_values/test_swap_values.py +++ b/kyu_8/swap_values/test_swap_values.py @@ -1,5 +1,6 @@ """ -Test for -> Swap Values +Test for -> Swap Values. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -27,13 +28,13 @@ name='Source/Kata') # pylint: enable-msg=R0801 class SwapValuesTestCase(unittest.TestCase): - """ - Testing swap_values function - """ + """Testing swap_values function.""" def test_swap_values(self): """ - Testing swap_values function + Testing swap_values function with various test data. + + :return: """ # pylint: disable=R0801 allure.dynamic.title("Testing swap_values function") @@ -49,7 +50,6 @@ def test_swap_values(self): swap: list = [1, 2] expected: list = [2, 1] swap_values(swap) - print_log(list=swap, expected=expected) self.assertEqual(swap[0], 2) self.assertEqual(swap[1], 1) From 058650e7162fb35d040876bc682e0a3590abc618 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:58:59 -0800 Subject: [PATCH 078/107] Grasshopper - Terminal game move function. --- kyu_8/terminal_game_move_function/__init__.py | 1 + .../terminal_game_move_function.py | 11 +++++++---- .../test_terminal_game_move_function.py | 17 ++++++++--------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/kyu_8/terminal_game_move_function/__init__.py b/kyu_8/terminal_game_move_function/__init__.py index e69de29bb2d..7b2d7af469e 100644 --- a/kyu_8/terminal_game_move_function/__init__.py +++ b/kyu_8/terminal_game_move_function/__init__.py @@ -0,0 +1 @@ +"""Grasshopper - Terminal game move function.""" diff --git a/kyu_8/terminal_game_move_function/terminal_game_move_function.py b/kyu_8/terminal_game_move_function/terminal_game_move_function.py index b57f9c4196f..34e3630693c 100644 --- a/kyu_8/terminal_game_move_function/terminal_game_move_function.py +++ b/kyu_8/terminal_game_move_function/terminal_game_move_function.py @@ -1,5 +1,6 @@ """ -Solution for -> Grasshopper - Terminal game move function +Solution for -> Grasshopper - Terminal game move function. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,11 +8,13 @@ def move(position: int, roll: int) -> int: """ + 'move' function. + A function for the terminal game that takes the current position of the hero and the roll (1-6) and return the new position. - :param position: - :param roll: - :return: + :param position: int + :param roll: int + :return: int """ return position + (roll * 2) diff --git a/kyu_8/terminal_game_move_function/test_terminal_game_move_function.py b/kyu_8/terminal_game_move_function/test_terminal_game_move_function.py index f236d17e6bd..dc8942074c8 100644 --- a/kyu_8/terminal_game_move_function/test_terminal_game_move_function.py +++ b/kyu_8/terminal_game_move_function/test_terminal_game_move_function.py @@ -1,5 +1,6 @@ """ -Test for -> Grasshopper - Terminal game move function +Test for -> Grasshopper - Terminal game move function. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -26,17 +27,12 @@ name='Source/Kata') # pylint: enable=R0801 class MoveTestCase(unittest.TestCase): - """ - Testing move function - """ + """Testing move function.""" def test_move(self): """ - The player rolls the dice and moves the number - of spaces indicated by the dice two times. + Testing 'move' function with various test data. - Pass position and roll and compare the output - to the expected result :return: """ # pylint: disable=R0801 @@ -47,7 +43,10 @@ def test_move(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>The player rolls the dice and moves the number" + "of spaces indicated by the dice two times.</p>" + "<p>Pass position and roll and compare the output" + "to the expected result.</p>") # pylint: enable=R0801 with allure.step("Test start position zero"): position: int = 0 From f7652d870c7e8682d02bb2c20e78cefbacae25e6 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:03:43 -0800 Subject: [PATCH 079/107] The Feast of Many Beasts. --- kyu_8/the_feast_of_many_beasts/__init__.py | 1 + kyu_8/the_feast_of_many_beasts/feast.py | 7 ++-- kyu_8/the_feast_of_many_beasts/test_feast.py | 38 +++++++++----------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/kyu_8/the_feast_of_many_beasts/__init__.py b/kyu_8/the_feast_of_many_beasts/__init__.py index e69de29bb2d..affe7c98b82 100644 --- a/kyu_8/the_feast_of_many_beasts/__init__.py +++ b/kyu_8/the_feast_of_many_beasts/__init__.py @@ -0,0 +1 @@ +"""The Feast of Many Beasts.""" diff --git a/kyu_8/the_feast_of_many_beasts/feast.py b/kyu_8/the_feast_of_many_beasts/feast.py index d32a6f57b4c..f57febf2c20 100644 --- a/kyu_8/the_feast_of_many_beasts/feast.py +++ b/kyu_8/the_feast_of_many_beasts/feast.py @@ -1,5 +1,6 @@ """ -Solution for -> The Feast of Many Beasts +Solution for -> The Feast of Many Beasts. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,7 +8,9 @@ def feast(beast: str, dish: str) -> bool: """ - A function feast that takes the animal's name and + 'feast' function. + + A function that takes the animal's name and dish as arguments and returns true or false to indicate whether the beast is allowed to bring the dish to the feast. diff --git a/kyu_8/the_feast_of_many_beasts/test_feast.py b/kyu_8/the_feast_of_many_beasts/test_feast.py index 4e71ede1a98..7e3c9344973 100644 --- a/kyu_8/the_feast_of_many_beasts/test_feast.py +++ b/kyu_8/the_feast_of_many_beasts/test_feast.py @@ -1,5 +1,6 @@ """ -Test for -> The Feast of Many Beasts +Test for -> The Feast of Many Beasts. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -26,29 +27,12 @@ name='Source/Kata') # pylint: enable=R0801 class FeastTestCase(unittest.TestCase): - """ - Testing 'feast' function - """ + """Testing 'feast' function.""" def test_feast(self): """ - Testing 'feast' function with various test inputs - - Testing a function feast that takes the animal's - name and dish as arguments and returns true or - false to indicate whether the beast is allowed - to bring the dish to the feast. - - Assume that beast and dish are always lowercase strings, - and that each has at least two letters. beast and dish - may contain hyphens and spaces, but these will not appear - at the beginning or end of the string. They will not - contain numerals. + Testing 'feast' function with various test inputs. - There is just one rule: the dish must start and end with - the same letters as the animal's name. For example, the - great blue heron is bringing garlic naan and the chickadee - is bringing chocolate cake. :return: """ # pylint: disable=R0801 @@ -59,7 +43,19 @@ def test_feast(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>Testing a function feast that takes the animal's " + "name and dish as arguments and returns true or " + "false to indicate whether the beast is allowed " + "to bring the dish to the feast.</p>" + "<p>Assume that beast and dish are always lowercase strings, " + "and that each has at least two letters. beast and dish " + "may contain hyphens and spaces, but these will not appear " + "at the beginning or end of the string. They will not " + "contain numerals.</p>" + "<p>There is just one rule: the dish must start and end with " + "the same letters as the animal's name. For example, the " + "great blue heron is bringing garlic naan and the chickadee " + "is bringing chocolate cake.</p>") # pylint: enable=R0801 with allure.step("Enter animal's name and dish " "as arguments and assert the output"): From ea578389c99fa8544b9048df6732b2ff9d06f274 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:07:52 -0800 Subject: [PATCH 080/107] Third Angle of a Triangle. --- kyu_8/third_angle_of_triangle/__init__.py | 1 + .../test_third_angle_of_triangle.py | 38 ++++++------------- .../third_angle_of_triangle.py | 5 ++- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/kyu_8/third_angle_of_triangle/__init__.py b/kyu_8/third_angle_of_triangle/__init__.py index e69de29bb2d..5f11b606f95 100644 --- a/kyu_8/third_angle_of_triangle/__init__.py +++ b/kyu_8/third_angle_of_triangle/__init__.py @@ -0,0 +1 @@ +"""Third Angle of a Triangle.""" diff --git a/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py b/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py index c1cceafebcc..353637dacae 100644 --- a/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py +++ b/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py @@ -1,5 +1,6 @@ """ -Test for -> Third Angle of a Triangle +Test for -> Third Angle of a Triangle. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -26,14 +27,12 @@ name='Source/Kata') # pylint: enable-msg=R0801 class OtherAngleTestCase(unittest.TestCase): - """ - Testing other_angle - """ + """Testing other_angle function.""" def test_other_angle(self): """ - You are given two angles (in degrees) of a triangle. - Find the 3rd. + Testing other_angle function with various test data. + :return: """ # pylint: disable-msg=R0801 @@ -44,28 +43,21 @@ def test_other_angle(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>You are given two angles (in degrees) of a triangle." + "Find the 3rd.</p>") # pylint: enable-msg=R0801 with allure.step("Enter values of two angles and return the 3rd"): a: int = 30 b: int = 60 expected: int = 90 - - print_log(a=a, - b=b, - expected=expected) - + print_log(a=a, b=b, expected=expected) self.assertEqual(other_angle(a, b), expected) with allure.step("Enter values of two angles and return the 3rd"): a = 60 b = 60 expected = 60 - - print_log(a=a, - b=b, - expected=expected) - + print_log(a=a, b=b, expected=expected) self.assertEqual(other_angle(a, b), expected) self.assertEqual(other_angle(60, 60), 60) @@ -73,20 +65,12 @@ def test_other_angle(self): a = 43 b = 78 expected = 59 - - print_log(a=a, - b=b, - expected=expected) - + print_log(a=a, b=b, expected=expected) self.assertEqual(other_angle(a, b), expected) with allure.step("Enter values of two angles and return the 3rd"): a = 10 b = 20 expected = 150 - - print_log(a=a, - b=b, - expected=expected) - + print_log(a=a, b=b, expected=expected) self.assertEqual(other_angle(a, b), expected) diff --git a/kyu_8/third_angle_of_triangle/third_angle_of_triangle.py b/kyu_8/third_angle_of_triangle/third_angle_of_triangle.py index 4be2862e8a5..560700e45e0 100644 --- a/kyu_8/third_angle_of_triangle/third_angle_of_triangle.py +++ b/kyu_8/third_angle_of_triangle/third_angle_of_triangle.py @@ -1,5 +1,6 @@ """ -Solution for -> Third Angle of a Triangle +Solution for -> Third Angle of a Triangle. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,6 +8,8 @@ def other_angle(a: int, b: int) -> int: """ + Calculate 3rd angle. + You are given two angles (in degrees) of a triangle. Write a function to return the 3rd. Note: only positive integers will be tested. From 36b83c29fe81c9964662da8cf5a146af1d576864 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:13:09 -0800 Subject: [PATCH 081/107] Well of Ideas - Easy Version --- kyu_8/well_of_ideas_easy_version/__init__.py | 1 + .../test_well_of_ideas_easy_version.py | 30 +++++++++---------- .../well_of_ideas_easy_version.py | 8 ++--- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/kyu_8/well_of_ideas_easy_version/__init__.py b/kyu_8/well_of_ideas_easy_version/__init__.py index e69de29bb2d..c4a87c311a7 100644 --- a/kyu_8/well_of_ideas_easy_version/__init__.py +++ b/kyu_8/well_of_ideas_easy_version/__init__.py @@ -0,0 +1 @@ +"""Well of Ideas - Easy Version.""" diff --git a/kyu_8/well_of_ideas_easy_version/test_well_of_ideas_easy_version.py b/kyu_8/well_of_ideas_easy_version/test_well_of_ideas_easy_version.py index 98a48f7b720..a176416565b 100644 --- a/kyu_8/well_of_ideas_easy_version/test_well_of_ideas_easy_version.py +++ b/kyu_8/well_of_ideas_easy_version/test_well_of_ideas_easy_version.py @@ -1,5 +1,6 @@ """ -Tests for -> Well of Ideas - Easy Version +Tests for -> Well of Ideas - Easy Version. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -29,14 +30,12 @@ name='Source/Kata') # pylint: enable=R0801 class WellTestCase(unittest.TestCase): - """ - Testing well function - """ + """Testing 'well' function.""" def test_well_fail(self): """ - If there are no good ideas, - as is often the case, return 'Fail!'. + If there are no good ideas, as is often the case, return 'Fail!'. + :return: """ # pylint: disable=R0801 @@ -44,10 +43,11 @@ def test_well_fail(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>If there are no good ideas, return 'Fail!'.</p>") # pylint: enable=R0801 with allure.step("Pass list with no 'good' in it"): lst: list = ['bad', 'bad', 'bad'] @@ -57,8 +57,8 @@ def test_well_fail(self): def test_well_publish(self): """ - If there are one or two good ideas, - return 'Publish!', + If there are one or two good ideas, return 'Publish!'. + :return: """ # pylint: disable=R0801 @@ -69,7 +69,7 @@ def test_well_publish(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>If there are one or two good ideas, return 'Publish!'</p>") # pylint: enable=R0801 with allure.step("Pass list with one 'good' in it"): lst: list = ['good', 'bad', 'bad', 'bad', 'bad'] @@ -79,8 +79,8 @@ def test_well_publish(self): def test_well_series(self): """ - if there are more than 2 return - 'I smell a series!'. + If there are more than 2 return 'I smell a series!'. + :return: """ # pylint: disable=R0801 @@ -91,7 +91,7 @@ def test_well_series(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>If there are more than 2 return 'I smell a series!'</p>") # pylint: enable=R0801 with allure.step("Pass list with more than 2 'good' in it"): lst: list = ['good', 'bad', 'bad', diff --git a/kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py b/kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py index 1537dd77892..c8a19a9490d 100644 --- a/kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py +++ b/kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py @@ -1,5 +1,6 @@ """ -Solution for -> Well of Ideas - Easy Version +Solution for -> Well of Ideas - Easy Version. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -9,9 +10,8 @@ def well(x: List[str]) -> str: """ - If there are one or two good ideas, return 'Publish!'. - If there are more than 2 return 'I smell a series!'. - If there are no good ideas, return 'Fail!'. + 'well' function + :param x: List[str] :return: str """ From 6b9f1b33d6fd806d2c0aa55f8b8d6bb6571645e5 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:17:39 -0800 Subject: [PATCH 082/107] Will there be enough space?. --- kyu_8/will_there_be_enough_space/__init__.py | 1 + kyu_8/will_there_be_enough_space/enough.py | 3 +- .../will_there_be_enough_space/test_enough.py | 55 ++++++++----------- 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/kyu_8/will_there_be_enough_space/__init__.py b/kyu_8/will_there_be_enough_space/__init__.py index e69de29bb2d..dfef7dcb40f 100644 --- a/kyu_8/will_there_be_enough_space/__init__.py +++ b/kyu_8/will_there_be_enough_space/__init__.py @@ -0,0 +1 @@ +"""Will there be enough space.""" diff --git a/kyu_8/will_there_be_enough_space/enough.py b/kyu_8/will_there_be_enough_space/enough.py index aac42941813..3ed26defd6f 100644 --- a/kyu_8/will_there_be_enough_space/enough.py +++ b/kyu_8/will_there_be_enough_space/enough.py @@ -1,5 +1,6 @@ """ -Solution for -> Will there be enough space? +Solution for -> Will there be enough space?. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ diff --git a/kyu_8/will_there_be_enough_space/test_enough.py b/kyu_8/will_there_be_enough_space/test_enough.py index cb537d703fd..fe941f70f34 100644 --- a/kyu_8/will_there_be_enough_space/test_enough.py +++ b/kyu_8/will_there_be_enough_space/test_enough.py @@ -1,5 +1,6 @@ """ -Tests for -> Will there be enough space? +Tests for -> Will there be enough space?. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.will_there_be_enough_space.enough import enough @@ -26,46 +28,37 @@ name='Source/Kata') # pylint: enable=R0801 class EnoughTestCase(unittest.TestCase): - """ - Testing enough function - """ + """Testing enough function.""" - def test_enough(self): + @parameterized.expand([ + ((10, 5, 5), 0), + ((100, 60, 50), 10), + ((20, 5, 5), 0)]) + def test_enough(self, test_dat, expected): """ - Testing enough function - with various test data + Testing enough function with various test data. - If there is enough space, return 0, - and if there isn't, return the number - of passengers he can't take. :return: """ # pylint: disable=R0801 - allure.dynamic.title("STesting enough function") + allure.dynamic.title("Testing enough function") allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>If there is enough space, return 0, " + "and if there isn't, return the number " + "of passengers he can't take.</p>") # pylint: enable=R0801 - with allure.step("Enter test data and " - "verify the output"): - test_data: tuple = ( - ((10, 5, 5), 0), - ((100, 60, 50), 10), - ((20, 5, 5), 0)) - - for test_dat, expected in test_data: - cap: int = test_dat[0] - on: int = test_dat[1] - wait: int = test_dat[2] - - print_log(cap=cap, - on=on, - wait=wait, - expected=expected) - - self.assertEqual(expected, - enough(cap, on, wait)) + with allure.step(f"Enter test data: {test_dat} " + f"and verify the expected output: {expected}."): + cap: int = test_dat[0] + on: int = test_dat[1] + wait: int = test_dat[2] + print_log(cap=cap, + on=on, + wait=wait, + expected=expected) + self.assertEqual(expected, enough(cap, on, wait)) From 309a6ef0d8e131161be12c69dbd41bfc0e29d9ce Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:22:43 -0800 Subject: [PATCH 083/107] # Will you make it --- kyu_8/will_you_make_it/README.md | 2 +- kyu_8/will_you_make_it/__init__.py | 1 + kyu_8/will_you_make_it/test_zero_fuel.py | 49 +++++++++++------------- kyu_8/will_you_make_it/zero_fuel.py | 10 +++-- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/kyu_8/will_you_make_it/README.md b/kyu_8/will_you_make_it/README.md index 609ab919f9f..1daf2e24c9d 100644 --- a/kyu_8/will_you_make_it/README.md +++ b/kyu_8/will_you_make_it/README.md @@ -1,4 +1,4 @@ -# Will you make it +# Will you make it? You were camping with your friends far away from home, but when it's time to go back, you realize that you fuel is running out diff --git a/kyu_8/will_you_make_it/__init__.py b/kyu_8/will_you_make_it/__init__.py index e69de29bb2d..8c9870dbbff 100644 --- a/kyu_8/will_you_make_it/__init__.py +++ b/kyu_8/will_you_make_it/__init__.py @@ -0,0 +1 @@ +"""Will you make it?.""" diff --git a/kyu_8/will_you_make_it/test_zero_fuel.py b/kyu_8/will_you_make_it/test_zero_fuel.py index 6ef2863739f..25be63c50e0 100644 --- a/kyu_8/will_you_make_it/test_zero_fuel.py +++ b/kyu_8/will_you_make_it/test_zero_fuel.py @@ -1,5 +1,6 @@ """ -Tests for -> Will you make it? +Tests for -> Will you make it?. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from kyu_8.will_you_make_it.zero_fuel import zero_fuel from utils.log_func import print_log @@ -28,13 +30,15 @@ name='Source/Kata') # pylint: enable=R0801 class ZeroFuelTestCase(unittest.TestCase): - """ - Testing zero_fuel - """ + """Testing zero_fuel function.""" - def test_zero_fuel(self): + @parameterized.expand([ + ((50, 25, 2), True), + ((100, 50, 1), False)]) + def test_zero_fuel(self, data, expected): """ - Testing the function with various test data + Testing the function with various test data. + :return: """ # pylint: disable=R0801 @@ -42,8 +46,9 @@ def test_zero_fuel(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' "<p>You were camping with your friends far away from home, " "but when it's time to go back, you realize that you fuel " @@ -51,23 +56,13 @@ def test_zero_fuel(self): "know that on average, your car runs on about 25 miles per " "gallon. There are 2 gallons left. Considering these factors, " "write a function that tells you if it is possible to get to " - "the pump or not. Function should return true (1 in Prolog) if " - "it is possible and false (0 in Prolog) if not. The input values " - "are always positive.</p>") + "the pump or not. Function should return true (1 in Prolog) " + "if it is possible and false (0 in Prolog) if not. The input " + "values are always positive.</p>") # pylint: enable=R0801 - test_data: tuple = ( - ((50, 25, 2), True), - ((100, 50, 1), False)) - - for data, expected in test_data: - actual_result = zero_fuel(data[0], data[1], data[2]) - with allure.step(f"Enter data ({data}) and verify the " - f"expected output ({expected}) " - f"vs actual result ({actual_result})"): - - print_log(data=data, - expected=expected, - result=actual_result) - - self.assertEqual(expected, - actual_result) + actual_result = zero_fuel(data[0], data[1], data[2]) + with allure.step(f"Enter data ({data}) and verify the " + f"expected output ({expected}) " + f"vs actual result ({actual_result})"): + print_log(data=data, expected=expected, result=actual_result) + self.assertEqual(expected, actual_result) diff --git a/kyu_8/will_you_make_it/zero_fuel.py b/kyu_8/will_you_make_it/zero_fuel.py index dfdc00d6572..0e97db3fb85 100644 --- a/kyu_8/will_you_make_it/zero_fuel.py +++ b/kyu_8/will_you_make_it/zero_fuel.py @@ -1,12 +1,17 @@ """ -Solution for -> Will you make it? +Solution for -> Will you make it?. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ -def zero_fuel(distance_to_pump: int, mpg: int, fuel_left: int) -> bool: +def zero_fuel(distance_to_pump: int, + mpg: int, + fuel_left: int) -> bool: """ + 'zero_fuel' function. + You were camping with your friends far away from home, but when it's time to go back, you realize that you fuel is running out and the nearest pump is 50 miles away! @@ -16,7 +21,6 @@ def zero_fuel(distance_to_pump: int, mpg: int, fuel_left: int) -> bool: to get to the pump or not. Function should return true (1 in Prolog) if it is possible and false (0 in Prolog) if not. The input values are always positive. - :param distance_to_pump: int :param mpg: int :param fuel_left: int From 746f6d160bb312ac31de0cf1ac1845728f5f4e09 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:29:35 -0800 Subject: [PATCH 084/107] A wolf in sheep's clothing. --- kyu_8/wolf_in_sheep_clothing/__init__.py | 1 + .../test_wolf_in_sheep_clothing.py | 28 +++++++++++++------ .../wolf_in_sheep_clothing.py | 6 ++-- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/kyu_8/wolf_in_sheep_clothing/__init__.py b/kyu_8/wolf_in_sheep_clothing/__init__.py index e69de29bb2d..6833659fbbf 100644 --- a/kyu_8/wolf_in_sheep_clothing/__init__.py +++ b/kyu_8/wolf_in_sheep_clothing/__init__.py @@ -0,0 +1 @@ +"""A wolf in sheep's clothing.""" diff --git a/kyu_8/wolf_in_sheep_clothing/test_wolf_in_sheep_clothing.py b/kyu_8/wolf_in_sheep_clothing/test_wolf_in_sheep_clothing.py index 5fd1ee09df0..b7f440e2cea 100644 --- a/kyu_8/wolf_in_sheep_clothing/test_wolf_in_sheep_clothing.py +++ b/kyu_8/wolf_in_sheep_clothing/test_wolf_in_sheep_clothing.py @@ -1,5 +1,6 @@ """ -Tests for -> A wolf in sheep's clothing +Tests for -> A wolf in sheep's clothing. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -24,16 +25,17 @@ 'ARRAYS', 'LOOPS', 'CONTROL FLOW') -@allure.link(url='https://www.codewars.com/kata/5c8bfa44b9d1192e1ebd3d15', - name='Source/Kata') +@allure.link( + url='https://www.codewars.com/kata/5c8bfa44b9d1192e1ebd3d15', + name='Source/Kata') # pylint: enable=R0801 class WarnTheSheepTestCase(unittest.TestCase): - """ - Testing warn_the_sheep function - """ + """Testing warn_the_sheep function.""" def test_warn_the_sheep_wolf_at_start(self): """ + Test the 'warn' func when the wolf in the beginning. + If the wolf is the closest animal to you, return "Pls go away and stop eating my sheep". :return: @@ -46,7 +48,8 @@ def test_warn_the_sheep_wolf_at_start(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>If the wolf is the closest animal to you, " + "return \"Pls go away and stop eating my sheep\".</p>") # pylint: enable=R0801 lst: list = ['wolf', 'sheep', 'sheep', 'sheep', 'sheep', 'sheep', @@ -60,6 +63,8 @@ def test_warn_the_sheep_wolf_at_start(self): def test_warn_the_sheep_wolf_in_middle(self): """ + Test the 'warn' func when the wolf in the middle. + If the wolf is the closest animal to you, return "Pls go away and stop eating my sheep". :return: @@ -72,7 +77,8 @@ def test_warn_the_sheep_wolf_in_middle(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>If the wolf is the closest animal to you, " + "return \"Pls go away and stop eating my sheep\".</p>") # pylint: enable=R0801 # 1 lst: list = ['sheep', 'sheep', 'sheep', @@ -107,6 +113,8 @@ def test_warn_the_sheep_wolf_in_middle(self): def test_warn_the_sheep_wolf_at_end(self): """ + Test the 'warn' func when the wolf in the end. + If the wolf is not the closest animal to you, return "Oi! Sheep number N! You are about to be eaten by a wolf!" where N is the sheep's position in the queue. @@ -120,7 +128,9 @@ def test_warn_the_sheep_wolf_at_end(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>If the wolf is not the closest animal to you, " + "return \"Oi! Sheep number N! You are about to be eaten by a wolf!\" " + "where N is the sheep's position in the queue.</p>") # pylint: enable=R0801 lst: list = ['sheep', 'sheep', 'wolf'] expected: str = 'Pls go away and stop eating my sheep' diff --git a/kyu_8/wolf_in_sheep_clothing/wolf_in_sheep_clothing.py b/kyu_8/wolf_in_sheep_clothing/wolf_in_sheep_clothing.py index 7057389988e..628457e199f 100644 --- a/kyu_8/wolf_in_sheep_clothing/wolf_in_sheep_clothing.py +++ b/kyu_8/wolf_in_sheep_clothing/wolf_in_sheep_clothing.py @@ -1,5 +1,6 @@ """ -Solution for -> A wolf in sheep's clothing +Solution for -> A wolf in sheep's clothing. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,8 +8,7 @@ def warn_the_sheep(queue: list) -> str: """ - Warn the sheep in front of the wolf - that it is about to be eaten. + Warn the sheep in front of the wolf. If the wolf is the closest animal to you, return "Pls go away and stop eating my sheep". From 5083d4504bc8dca7c59f15a91d803b3f96c92086 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:36:31 -0800 Subject: [PATCH 085/107] # Keep Hydrated --- kyu_8/keep_hydrated/__init__.py | 1 + kyu_8/keep_hydrated/keep_hydrated.py | 5 ++- kyu_8/keep_hydrated/test_keep_hydrated.py | 48 +++++++++++++---------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/kyu_8/keep_hydrated/__init__.py b/kyu_8/keep_hydrated/__init__.py index e69de29bb2d..7240da1b8cc 100644 --- a/kyu_8/keep_hydrated/__init__.py +++ b/kyu_8/keep_hydrated/__init__.py @@ -0,0 +1 @@ +"""Keep Hydrated.""" diff --git a/kyu_8/keep_hydrated/keep_hydrated.py b/kyu_8/keep_hydrated/keep_hydrated.py index 454ab57d457..a1bf20807cb 100644 --- a/kyu_8/keep_hydrated/keep_hydrated.py +++ b/kyu_8/keep_hydrated/keep_hydrated.py @@ -1,5 +1,6 @@ """ -Solution for -> Keep Hydrated! +Solution for -> Keep Hydrated!. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,6 +8,8 @@ def litres(time) -> int: """ + 'litres' function. + Because Nathan knows it is important to stay hydrated, he drinks 0.5 litres of water per hour of cycling. diff --git a/kyu_8/keep_hydrated/test_keep_hydrated.py b/kyu_8/keep_hydrated/test_keep_hydrated.py index e8e64b29b50..54f73cc6f56 100644 --- a/kyu_8/keep_hydrated/test_keep_hydrated.py +++ b/kyu_8/keep_hydrated/test_keep_hydrated.py @@ -1,5 +1,6 @@ """ -Test for -> Keep Hydrated! +Test for -> Keep Hydrated!. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.keep_hydrated.keep_hydrated import litres @@ -28,13 +30,20 @@ name='Source/Kata') # pylint: disable=R0801 class KeepHydratedTestCase(unittest.TestCase): - """ - Testing litres function - """ + """Testing litres function.""" - def test_keep_hydrated(self): + @parameterized.expand([ + (2, 1, 'should return 1 litre'), + (1.4, 0, 'should return 0 litres'), + (12.3, 6, 'should return 6 litres'), + (0.82, 0, 'should return 0 litres'), + (11.8, 5, 'should return 5 litres'), + (1787, 893, 'should return 893 litres'), + (0, 0, 'should return 0 litres')]) + def test_keep_hydrated(self, hours, expected, message): """ - Testing litres function with various test inputs + Testing litres function with various test inputs. + :return: """ # pylint: disable=R0801 @@ -45,18 +54,17 @@ def test_keep_hydrated(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>" + "Because Nathan knows it is important to stay hydrated, " + " he drinks 0.5 litres of water per hour of cycling." + "</p>" + "<p>" + "You get given the time in hours and you need to return " + "the number of litres Nathan will drink, rounded " + "to the smallest value." + "</p>") # pylint: enable=R0801 - with allure.step("Enter hours and verify the output"): - test_data: tuple = ( - (2, 1, 'should return 1 litre'), - (1.4, 0, 'should return 0 litres'), - (12.3, 6, 'should return 6 litres'), - (0.82, 0, 'should return 0 litres'), - (11.8, 5, 'should return 5 litres'), - (1787, 893, 'should return 893 litres'), - (0, 0, 'should return 0 litres')) - - for hours, expected, message in test_data: - print_log(hours=hours, expected=expected) - self.assertEqual(expected, litres(hours), message) + with allure.step(f"Enter hours: {hours} " + f"and verify the expected output: {expected}."): + print_log(hours=hours, expected=expected) + self.assertEqual(expected, litres(hours), message) From fd0ddb59f22d921f530c518920692a964099f809 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:39:01 -0800 Subject: [PATCH 086/107] Update evaluator.py kyu_8/greek_sort/evaluator.py:10 in public function `evaluator`: D401: First line should be in imperative mood (perhaps 'Evaluate', not 'Evaluator') [Docstring] prescribes the function or method's effect as a command: ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". --- kyu_8/greek_sort/evaluator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/greek_sort/evaluator.py b/kyu_8/greek_sort/evaluator.py index 87ee1fa7f28..f32ba347cc9 100644 --- a/kyu_8/greek_sort/evaluator.py +++ b/kyu_8/greek_sort/evaluator.py @@ -8,7 +8,7 @@ def evaluator(result: int, expected: str) -> bool: """ - Evaluator function. + 'evaluator' function. :param result: int :param expected: str From d08cdaac2d08001162f5e2c8ac11b895b8de9f86 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:39:52 -0800 Subject: [PATCH 087/107] Update make_upper_case.py kyu_8/make_upper_case/make_upper_case.py:10 in public function `make_upper_case`: D401: First line should be in imperative mood; try rephrasing (found 'Function') [Docstring] prescribes the function or method's effect as a command: ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". --- kyu_8/make_upper_case/make_upper_case.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/make_upper_case/make_upper_case.py b/kyu_8/make_upper_case/make_upper_case.py index 29dc55c42db..b2dd792edbb 100644 --- a/kyu_8/make_upper_case/make_upper_case.py +++ b/kyu_8/make_upper_case/make_upper_case.py @@ -8,7 +8,7 @@ def make_upper_case(s: str) -> str: """ - Function that convert to UpperCase. + Convert to UpperCase. :param s: str :return: str From f32c8cdb607d33a280ca03fa9542fa22f0e358ca Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:40:57 -0800 Subject: [PATCH 088/107] Update enough.py kyu_8/will_there_be_enough_space/enough.py:10 in public function `enough`: D401: First line should be in imperative mood; try rephrasing (found 'The') [Docstring] prescribes the function or method's effect as a command: ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". --- kyu_8/will_there_be_enough_space/enough.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kyu_8/will_there_be_enough_space/enough.py b/kyu_8/will_there_be_enough_space/enough.py index 3ed26defd6f..c320e23d1e7 100644 --- a/kyu_8/will_there_be_enough_space/enough.py +++ b/kyu_8/will_there_be_enough_space/enough.py @@ -8,6 +8,8 @@ def enough(cap: int, on: int, wait: int) -> int: """ + 'enough' function. + The driver wants you to write a simple program telling him if he will be able to fit all the passengers. @@ -19,7 +21,6 @@ def enough(cap: int, on: int, wait: int) -> int: cap is the amount of people the bus can hold excluding the driver. on is the number of people on the bus. wait is the number of people waiting to get on to the bus. - :param cap: int :param on: int :param wait: int From aced1dbeddf112653683ae9e145b5163b8391539 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:45:14 -0800 Subject: [PATCH 089/107] keep_up_the_hoop kyu_8/keep_up_the_hoop/hoop_count.py:1 at module level: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/keep_up_the_hoop/hoop_count.py:1 at module level: D400: First line should end with a period (not 'p') The [first line of a] docstring is a phrase ending in a period. kyu_8/keep_up_the_hoop/hoop_count.py:9 in public function `hoop_count`: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/keep_up_the_hoop/hoop_count.py:9 in public function `hoop_count`: D400: First line should end with a period (not 'e') The [first line of a] docstring is a phrase ending in a period. kyu_8/keep_up_the_hoop/hoop_count.py:9 in public function `hoop_count`: D401: First line should be in imperative mood; try rephrasing (found 'A') [Docstring] prescribes the function or method's effect as a command: ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". kyu_8/keep_up_the_hoop/__init__.py:1 at module level: D104: Missing docstring in public package All modules should normally have docstrings. [...] all functions and classes exported by a module should also have docstrings. Public methods (including the __init__ constructor) should also have docstrings. Note: Public (exported) definitions are either those with names listed in __all__ variable (if present), or those that do not start with a single underscore. kyu_8/keep_up_the_hoop/test_hoop_count.py:1 at module level: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/keep_up_the_hoop/test_hoop_count.py:1 at module level: D400: First line should end with a period (not 'p') The [first line of a] docstring is a phrase ending in a period. kyu_8/keep_up_the_hoop/test_hoop_count.py:28 in public class `HoopCountTestCase`: D200: One-line docstring should fit on one line with quotes (found 3) The closing quotes are on the same line as the opening quotes. This looks better for one-liners. kyu_8/keep_up_the_hoop/test_hoop_count.py:28 in public class `HoopCountTestCase`: D400: First line should end with a period (not 'n') The [first line of a] docstring is a phrase ending in a period. kyu_8/keep_up_the_hoop/test_hoop_count.py:33 in public method `test_hoop_count_positive`: D400: First line should end with a period (not ')') The [first line of a] docstring is a phrase ending in a period. kyu_8/keep_up_the_hoop/test_hoop_count.py:66 in public method `test_hoop_count_negative`: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/keep_up_the_hoop/test_hoop_count.py:66 in public method `test_hoop_count_negative`: D400: First line should end with a period (not ')') The [first line of a] docstring is a phrase ending in a period. --- kyu_8/keep_up_the_hoop/__init__.py | 1 + kyu_8/keep_up_the_hoop/hoop_count.py | 8 +++++--- kyu_8/keep_up_the_hoop/test_hoop_count.py | 19 +++++++++---------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/kyu_8/keep_up_the_hoop/__init__.py b/kyu_8/keep_up_the_hoop/__init__.py index e69de29bb2d..c1749419584 100644 --- a/kyu_8/keep_up_the_hoop/__init__.py +++ b/kyu_8/keep_up_the_hoop/__init__.py @@ -0,0 +1 @@ +"""Keep up the hoop.""" diff --git a/kyu_8/keep_up_the_hoop/hoop_count.py b/kyu_8/keep_up_the_hoop/hoop_count.py index bff4cedf9a5..9badc57f057 100644 --- a/kyu_8/keep_up_the_hoop/hoop_count.py +++ b/kyu_8/keep_up_the_hoop/hoop_count.py @@ -1,5 +1,6 @@ """ -Solution -> Keep up the hoop +Solution -> Keep up the hoop. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -7,9 +8,10 @@ def hoop_count(n: int) -> str: """ - A program where Alex can input (n) how many times the - hoop goes round and it will return him an encouraging message + 'hoop_count' function. + A program where Alex can input (n) how many times the + hoop goes round, and it will return him an encouraging message :param n: int :return: str """ diff --git a/kyu_8/keep_up_the_hoop/test_hoop_count.py b/kyu_8/keep_up_the_hoop/test_hoop_count.py index ee377488e2d..fa5ae53c944 100644 --- a/kyu_8/keep_up_the_hoop/test_hoop_count.py +++ b/kyu_8/keep_up_the_hoop/test_hoop_count.py @@ -1,5 +1,6 @@ """ -Test -> Keep up the hoop +Test -> Keep up the hoop. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -25,22 +26,19 @@ name='Source/Kata') # pylint: enable=R0801 class HoopCountTestCase(unittest.TestCase): - """ - Testing hoop_count function - """ + """Testing hoop_count function.""" def test_hoop_count_positive(self): """ - Testing hoop_count function (positive) + Testing hoop_count function (positive). - Alex just got a new hula hoop, he loves it but feels + Alex just got a new hula-hoop, he loves it but feels discouraged because his little brother is better than him Write a program where Alex can input (n) how many times the hoop goes round and it will return him an encouraging message - 10 or more hoops, return "Great, now move on to tricks". - - Not 10 hoops, return "Keep at it until you get it". :return: @@ -54,7 +52,7 @@ def test_hoop_count_positive(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>Testing hoop_count function (positive).</p>") # pylint: enable=R0801 with allure.step("Enter n and verify the result"): n: int = 11 @@ -64,7 +62,8 @@ def test_hoop_count_positive(self): def test_hoop_count_negative(self): """ - Testing hoop_count function (negative) + Testing hoop_count function (negative). + :return: """ # pylint: disable=R0801 @@ -76,7 +75,7 @@ def test_hoop_count_negative(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>Testing hoop_count function (negative).</p>") # pylint: enable=R0801 with allure.step("Enter n and verify the result"): n: int = 3 From 78a128e27cf12ed9da745b57446791be23ba96a3 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:53:05 -0800 Subject: [PATCH 090/107] logical_calculator kyu_8/logical_calculator/test_logical_calculator.py:1 at module level: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/logical_calculator/test_logical_calculator.py:1 at module level: D400: First line should end with a period (not 'r') The [first line of a] docstring is a phrase ending in a period. kyu_8/logical_calculator/test_logical_calculator.py:30 in public class `LogicalCalculatorTestCase`: D200: One-line docstring should fit on one line with quotes (found 3) The closing quotes are on the same line as the opening quotes. This looks better for one-liners. kyu_8/logical_calculator/test_logical_calculator.py:30 in public class `LogicalCalculatorTestCase`: D400: First line should end with a period (not 'n') The [first line of a] docstring is a phrase ending in a period. kyu_8/logical_calculator/test_logical_calculator.py:35 in public method `test_logical_calc_and`: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/logical_calculator/test_logical_calculator.py:35 in public method `test_logical_calc_and`: D400: First line should end with a period (not 'l') The [first line of a] docstring is a phrase ending in a period. kyu_8/logical_calculator/test_logical_calculator.py:99 in public method `test_logical_calc_or`: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/logical_calculator/test_logical_calculator.py:99 in public method `test_logical_calc_or`: D400: First line should end with a period (not 'e') The [first line of a] docstring is a phrase ending in a period. kyu_8/logical_calculator/test_logical_calculator.py:157 in public method `test_logical_calc_xor`: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/logical_calculator/test_logical_calculator.py:157 in public method `test_logical_calc_xor`: D400: First line should end with a period (not 'a') The [first line of a] docstring is a phrase ending in a period. kyu_8/logical_calculator/__init__.py:1 at module level: D104: Missing docstring in public package All modules should normally have docstrings. [...] all functions and classes exported by a module should also have docstrings. Public methods (including the __init__ constructor) should also have docstrings. Note: Public (exported) definitions are either those with names listed in __all__ variable (if present), or those that do not start with a single underscore. kyu_8/logical_calculator/logical_calculator.py:1 at module level: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/logical_calculator/logical_calculator.py:1 at module level: D400: First line should end with a period (not 'r') The [first line of a] docstring is a phrase ending in a period. kyu_8/logical_calculator/logical_calculator.py:9 in public function `logical_calc`: D401: First line should be in imperative mood (perhaps 'Calculate', not 'Calculates') [Docstring] prescribes the function or method's effect as a command: ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". --- kyu_8/logical_calculator/__init__.py | 1 + .../logical_calculator/logical_calculator.py | 3 +- .../test_logical_calculator.py | 42 +++++++++++-------- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/kyu_8/logical_calculator/__init__.py b/kyu_8/logical_calculator/__init__.py index e69de29bb2d..ef9d65f99ea 100644 --- a/kyu_8/logical_calculator/__init__.py +++ b/kyu_8/logical_calculator/__init__.py @@ -0,0 +1 @@ +"""Logical calculator.""" diff --git a/kyu_8/logical_calculator/logical_calculator.py b/kyu_8/logical_calculator/logical_calculator.py index 4bcf26788e6..f3dda92d72c 100644 --- a/kyu_8/logical_calculator/logical_calculator.py +++ b/kyu_8/logical_calculator/logical_calculator.py @@ -1,5 +1,6 @@ """ -Solution for -> Logical Calculator +Solution for -> Logical Calculator. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ diff --git a/kyu_8/logical_calculator/test_logical_calculator.py b/kyu_8/logical_calculator/test_logical_calculator.py index 7f4e11cc220..875e0f8bfa1 100644 --- a/kyu_8/logical_calculator/test_logical_calculator.py +++ b/kyu_8/logical_calculator/test_logical_calculator.py @@ -1,5 +1,6 @@ """ -Test for -> Logical Calculator +Test for -> Logical Calculator. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -27,21 +28,17 @@ name='Source/Kata') # pylint: enable=R0801 class LogicalCalculatorTestCase(unittest.TestCase): - """ - Testing logical_calc function - """ + """Testing logical_calc function.""" def test_logical_calc_and(self): """ - And (∧) is the truth-functional - operator of logical conjunction + And (∧) is the truth-functional operator of logical conjunction. - The and of a set of operands is true + The 'and' of a set of operands is true if and only if all of its operands are true. Source: https://en.wikipedia.org/wiki/Logical_conjunction - :return: """ # pylint: disable=R0801 @@ -49,10 +46,13 @@ def test_logical_calc_and(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>The 'and' of a set of operands is true " + "if and only if all of its operands are true." + "</p>") # pylint: enable=R0801 with allure.step("Pass an array with 2 members (negative)"): lst: list = [True, False] @@ -97,11 +97,13 @@ def test_logical_calc_and(self): def test_logical_calc_or(self): """ + Testing 'or'. + In logic and mathematics, or is the truth-functional operator of (inclusive) disjunction, also known as alternation. - The or of a set of operands is true if + The 'or' of a set of operands is true if and only if one or more of its operands is true. Source: @@ -117,7 +119,10 @@ def test_logical_calc_or(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>" + "The 'or' of a set of operands is true if " + "and only if one or more of its operands is true." + "</p>") # pylint: enable=R0801 with allure.step('Pass an array with 2 members (positive)'): lst: list = [True, False] @@ -155,7 +160,9 @@ def test_logical_calc_or(self): def test_logical_calc_xor(self): """ - Exclusive or or exclusive disjunction is a + Testing 'XOR'. + + Exclusive or exclusive disjunction is a logical operation that outputs true only when inputs differ (one is true, the other is false). @@ -170,10 +177,11 @@ def test_logical_calc_xor(self): allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html( '<h3>Codewars badge:</h3>' - '<img src="https://www.codewars.com/users/myFirstCode' - '/badges/large">' + '<img src="' + 'https://www.codewars.com/users/myFirstCode/badges/large' + '">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>XOR outputs true whenever the inputs differ.</p>") # pylint: enable=R0801 with allure.step('Pass an array with 2 members (positive)'): lst: list = [True, False] From 50e4ef2108082365f7b5592363459b67b4aa7e84 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:56:50 -0800 Subject: [PATCH 091/107] is_your_period_late kyu_8/is_your_period_late/__init__.py:1 at module level: D104: Missing docstring in public package All modules should normally have docstrings. [...] all functions and classes exported by a module should also have docstrings. Public methods (including the __init__ constructor) should also have docstrings. Note: Public (exported) definitions are either those with names listed in __all__ variable (if present), or those that do not start with a single underscore. kyu_8/is_your_period_late/test_is_your_period_late.py:1 at module level: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/is_your_period_late/test_is_your_period_late.py:1 at module level: D400: First line should end with a period (not 'e') The [first line of a] docstring is a phrase ending in a period. kyu_8/is_your_period_late/test_is_your_period_late.py:30 in public class `PeriodIsLateTestCase`: D200: One-line docstring should fit on one line with quotes (found 3) The closing quotes are on the same line as the opening quotes. This looks better for one-liners. kyu_8/is_your_period_late/test_is_your_period_late.py:30 in public class `PeriodIsLateTestCase`: D400: First line should end with a period (not 'n') The [first line of a] docstring is a phrase ending in a period. kyu_8/is_your_period_late/test_is_your_period_late.py:35 in public method `test_period_is_late_positive`: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/is_your_period_late/test_is_your_period_late.py:35 in public method `test_period_is_late_positive`: D400: First line should end with a period (not 's') The [first line of a] docstring is a phrase ending in a period. kyu_8/is_your_period_late/test_is_your_period_late.py:98 in public method `test_period_is_late_negative`: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/is_your_period_late/test_is_your_period_late.py:98 in public method `test_period_is_late_negative`: D400: First line should end with a period (not 's') The [first line of a] docstring is a phrase ending in a period. kyu_8/is_your_period_late/is_your_period_late.py:1 at module level: D205: 1 blank line required between summary line and description (found 0) Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. kyu_8/is_your_period_late/is_your_period_late.py:1 at module level: D400: First line should end with a period (not 'e') The [first line of a] docstring is a phrase ending in a period. --- kyu_8/is_your_period_late/__init__.py | 1 + .../is_your_period_late/is_your_period_late.py | 3 ++- .../test_is_your_period_late.py | 17 +++++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/kyu_8/is_your_period_late/__init__.py b/kyu_8/is_your_period_late/__init__.py index e69de29bb2d..0328c3963b9 100644 --- a/kyu_8/is_your_period_late/__init__.py +++ b/kyu_8/is_your_period_late/__init__.py @@ -0,0 +1 @@ +"""Is your period late.""" diff --git a/kyu_8/is_your_period_late/is_your_period_late.py b/kyu_8/is_your_period_late/is_your_period_late.py index 122f68b50c8..c310e5f4213 100644 --- a/kyu_8/is_your_period_late/is_your_period_late.py +++ b/kyu_8/is_your_period_late/is_your_period_late.py @@ -1,5 +1,6 @@ """ -Solution for -> Is your period late +Solution for -> Is your period late. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ diff --git a/kyu_8/is_your_period_late/test_is_your_period_late.py b/kyu_8/is_your_period_late/test_is_your_period_late.py index eb75b23032f..b47b73b21f7 100644 --- a/kyu_8/is_your_period_late/test_is_your_period_late.py +++ b/kyu_8/is_your_period_late/test_is_your_period_late.py @@ -1,5 +1,6 @@ """ -Test for -> Is your period late +Test for -> Is your period late. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -27,13 +28,12 @@ name='Source/Kata') # pylint: enable=R0801 class PeriodIsLateTestCase(unittest.TestCase): - """ - Testing period_is_late function - """ + """Testing period_is_late function.""" def test_period_is_late_positive(self): """ - Positive tests + Positive tests. + :return: """ # pylint: disable=R0801 @@ -44,7 +44,7 @@ def test_period_is_late_positive(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>Positive tests.</p>") # pylint: enable=R0801 with allure.step("Pass last, today and period length"): last: date = date(2016, 6, 13) @@ -96,7 +96,8 @@ def test_period_is_late_positive(self): def test_period_is_late_negative(self): """ - Negative tests + Negative tests. + :return: """ # pylint: disable=R0801 @@ -107,7 +108,7 @@ def test_period_is_late_negative(self): '<img src="https://www.codewars.com/users/myFirstCode' '/badges/large">' '<h3>Test Description:</h3>' - "<p></p>") + "<p>Negative tests.</p>") # pylint: enable=R0801 with allure.step("Pass last, today and period length"): last: date = date(2016, 6, 13) From 8c1169305f3c4bbc032f949b5b050d90adafd41d Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:59:48 -0800 Subject: [PATCH 092/107] set_alarm kyu_8/set_alarm/test_set_alarm.py:31 in public class `SetAlarmTestCase`: D200: One-line docstring should fit on one line with quotes (found 3) The closing quotes are on the same line as the opening quotes. This looks better for one-liners. kyu_8/set_alarm/test_set_alarm.py:31 in public class `SetAlarmTestCase`: D400: First line should end with a period (not 'n') The [first line of a] docstring is a phrase ending in a period. kyu_8/set_alarm/test_set_alarm.py:49 in public method `test_set_alarm`: D412: No blank lines allowed between a section header and its content ('Examples') --- kyu_8/set_alarm/test_set_alarm.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kyu_8/set_alarm/test_set_alarm.py b/kyu_8/set_alarm/test_set_alarm.py index 8343922b702..6e3d5820cb7 100644 --- a/kyu_8/set_alarm/test_set_alarm.py +++ b/kyu_8/set_alarm/test_set_alarm.py @@ -28,9 +28,7 @@ name='Source/Kata') # pylint: enable=R0801 class SetAlarmTestCase(unittest.TestCase): - """ - Testing set_alarm function - """ + """Testing set_alarm function.""" @parameterized.expand([ ((True, True), @@ -54,7 +52,7 @@ def test_set_alarm(self, test_input, expected, msg): under which you need to set an alarm). It should return false otherwise. - Examples: + Examples setAlarm(true, true) -> false setAlarm(false, true) -> false From 341a31f4e27032903f79ebe80091ff64d77fad66 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:01:24 -0800 Subject: [PATCH 093/107] Update test_set_alarm.py kyu_8/set_alarm/test_set_alarm.py:47 in public method `test_set_alarm`: D412: No blank lines allowed between a section header and its content ('Examples') --- kyu_8/set_alarm/test_set_alarm.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kyu_8/set_alarm/test_set_alarm.py b/kyu_8/set_alarm/test_set_alarm.py index 6e3d5820cb7..0b0643f102f 100644 --- a/kyu_8/set_alarm/test_set_alarm.py +++ b/kyu_8/set_alarm/test_set_alarm.py @@ -52,8 +52,7 @@ def test_set_alarm(self, test_input, expected, msg): under which you need to set an alarm). It should return false otherwise. - Examples - + Examples: setAlarm(true, true) -> false setAlarm(false, true) -> false setAlarm(false, false) -> false From 6532bb53f6204d492f4e6de77c53e278dca0794e Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:02:13 -0800 Subject: [PATCH 094/107] Update logical_calculator.py kyu_8/logical_calculator/logical_calculator.py:10 in public function `logical_calc`: D401: First line should be in imperative mood (perhaps 'Calculate', not 'Calculates') [Docstring] prescribes the function or method's effect as a command: ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". --- kyu_8/logical_calculator/logical_calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/logical_calculator/logical_calculator.py b/kyu_8/logical_calculator/logical_calculator.py index f3dda92d72c..39cfbe75614 100644 --- a/kyu_8/logical_calculator/logical_calculator.py +++ b/kyu_8/logical_calculator/logical_calculator.py @@ -8,7 +8,7 @@ def logical_calc(array: list, op: str) -> bool: """ - Calculates logical value of boolean array. + Calculate logical value of boolean array. Logical operations: AND, OR and XOR. From d908bcb9ca90643f4834007e9284289f56f5b6ca Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:03:15 -0800 Subject: [PATCH 095/107] Update check_exam.py kyu_8/check_the_exam/check_exam.py:37 in public function `char_processor`: D401: First line should be in imperative mood (perhaps 'Process', not 'Processing') [Docstring] prescribes the function or method's effect as a command: ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". --- kyu_8/check_the_exam/check_exam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/check_the_exam/check_exam.py b/kyu_8/check_the_exam/check_exam.py index 2651f359112..cf3d0a93805 100644 --- a/kyu_8/check_the_exam/check_exam.py +++ b/kyu_8/check_the_exam/check_exam.py @@ -35,7 +35,7 @@ def check_exam(arr1: list, arr2: list) -> int: def char_processor(char: tuple, results: list) -> None: """ - Processing chars based on specified rule. + Process chars based on specified rule. :param char: str :param results: list From ffff071cfec027379c483ac9cb8381e4594f845b Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:04:28 -0800 Subject: [PATCH 096/107] Update well_of_ideas_easy_version.py kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py:12 in public function `well`: D400: First line should end with a period (not 'n') The [first line of a] docstring is a phrase ending in a period. --- kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py b/kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py index c8a19a9490d..637a8e19afb 100644 --- a/kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py +++ b/kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py @@ -10,7 +10,7 @@ def well(x: List[str]) -> str: """ - 'well' function + 'well' function. :param x: List[str] :return: str From a6c59da57ad0f60a8e3d93e32e385445bcef6ba1 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:06:32 -0800 Subject: [PATCH 097/107] Update evaluator.py kyu_8/greek_sort/evaluator.py:10 in public function `evaluator`: D401: First line should be in imperative mood (perhaps 'Evaluate', not 'evaluator') [Docstring] prescribes the function or method's effect as a command: ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". --- kyu_8/greek_sort/evaluator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/greek_sort/evaluator.py b/kyu_8/greek_sort/evaluator.py index f32ba347cc9..e4bcc1e5f8e 100644 --- a/kyu_8/greek_sort/evaluator.py +++ b/kyu_8/greek_sort/evaluator.py @@ -8,7 +8,7 @@ def evaluator(result: int, expected: str) -> bool: """ - 'evaluator' function. + Comparator for a list of phonetic words. :param result: int :param expected: str From 82c1c83d47375fdcfbda52ee1b88daa8bda2a186 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:09:10 -0800 Subject: [PATCH 098/107] Update evaluator.py --- kyu_8/greek_sort/evaluator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/greek_sort/evaluator.py b/kyu_8/greek_sort/evaluator.py index e4bcc1e5f8e..908e2b3e7ff 100644 --- a/kyu_8/greek_sort/evaluator.py +++ b/kyu_8/greek_sort/evaluator.py @@ -8,7 +8,7 @@ def evaluator(result: int, expected: str) -> bool: """ - Comparator for a list of phonetic words. + Compare two arguments. :param result: int :param expected: str From 3f63da4e307bcbde9fee53f73eff09538dc24e42 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:22:01 -0800 Subject: [PATCH 099/107] Update test_third_angle_of_triangle.py --- kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py | 1 - 1 file changed, 1 deletion(-) diff --git a/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py b/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py index 353637dacae..39f3e1622cd 100644 --- a/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py +++ b/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py @@ -59,7 +59,6 @@ def test_other_angle(self): expected = 60 print_log(a=a, b=b, expected=expected) self.assertEqual(other_angle(a, b), expected) - self.assertEqual(other_angle(60, 60), 60) with allure.step("Enter values of two angles and return the 3rd"): a = 43 From f1d31ca43e92863ec6efd74a695a7d32f718c793 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:27:55 -0800 Subject: [PATCH 100/107] Update test_third_angle_of_triangle.py --- .../test_third_angle_of_triangle.py | 32 ++++--------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py b/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py index 39f3e1622cd..7066b65393e 100644 --- a/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py +++ b/kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py @@ -9,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from utils.log_func import print_log from kyu_8.third_angle_of_triangle.third_angle_of_triangle \ import other_angle @@ -29,7 +30,12 @@ class OtherAngleTestCase(unittest.TestCase): """Testing other_angle function.""" - def test_other_angle(self): + @parameterized.expand([ + (30, 60, 90), + (60, 60, 60), + (43, 78, 59), + (10, 20, 150)]) + def test_other_angle(self, a, b, expected): """ Testing other_angle function with various test data. @@ -47,29 +53,5 @@ def test_other_angle(self): "Find the 3rd.</p>") # pylint: enable-msg=R0801 with allure.step("Enter values of two angles and return the 3rd"): - a: int = 30 - b: int = 60 - expected: int = 90 - print_log(a=a, b=b, expected=expected) - self.assertEqual(other_angle(a, b), expected) - - with allure.step("Enter values of two angles and return the 3rd"): - a = 60 - b = 60 - expected = 60 - print_log(a=a, b=b, expected=expected) - self.assertEqual(other_angle(a, b), expected) - - with allure.step("Enter values of two angles and return the 3rd"): - a = 43 - b = 78 - expected = 59 - print_log(a=a, b=b, expected=expected) - self.assertEqual(other_angle(a, b), expected) - - with allure.step("Enter values of two angles and return the 3rd"): - a = 10 - b = 20 - expected = 150 print_log(a=a, b=b, expected=expected) self.assertEqual(other_angle(a, b), expected) From 73457ed871bbc9335b3d640571bdc0c8c3c646b8 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:36:40 -0800 Subject: [PATCH 101/107] pydocstyle for main --- .../workflows/lint_test_build_pipeline.yml | 3 + .github/workflows/pydocstyle.yml | 66 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/pydocstyle.yml diff --git a/.github/workflows/lint_test_build_pipeline.yml b/.github/workflows/lint_test_build_pipeline.yml index 28eaad4cef4..f2cd7abf847 100644 --- a/.github/workflows/lint_test_build_pipeline.yml +++ b/.github/workflows/lint_test_build_pipeline.yml @@ -22,6 +22,9 @@ jobs: yamllint: name: YAML Lint uses: iKostanOrg/codewars/.github/workflows/yamllint.yml@master + pydocstyle: + name: PYDOCSTYLE Lint + uses: iKostanOrg/codewars/.github/workflows/pydocstyle.yml@master pytest: name: Unitest with pytest needs: diff --git a/.github/workflows/pydocstyle.yml b/.github/workflows/pydocstyle.yml new file mode 100644 index 00000000000..83134517527 --- /dev/null +++ b/.github/workflows/pydocstyle.yml @@ -0,0 +1,66 @@ +--- +name: pydocstyle + +on: # yamllint disable-line rule:truthy + push: + branches: + - 'utils' + - 'none' + workflow_call: + +permissions: + contents: read + pull-requests: read + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.x"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + # This is the version of the action for setting up Python, + # not the Python version. + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + # You can test your matrix by printing the current Python version + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install -r requirements.txt + pip install pydocstyle + pip install types-requests + - name: Check to make sure that the module is in your Python path + run: | + echo $PYTHONPATH + - name: Check pydocstyle version + run: | + pydocstyle --version + # Pydocstyle testing (Guide) + # https://www.pydocstyle.org/en/stable/usage.html#cli-usage + - name: Doc style checking with pydocstyle for kyu_2 + run: | + pydocstyle --verbose --explain --count kyu_2 + - name: Doc style checking with pydocstyle for kyu_3 + run: | + pydocstyle --verbose --explain --count kyu_3 + - name: Doc style checking with pydocstyle for kyu_4 + run: | + pydocstyle --verbose --explain --count kyu_4 + - name: Doc style checking with pydocstyle for kyu_5 + run: | + pydocstyle --verbose --explain --count kyu_5 + - name: Doc style checking with pydocstyle for kyu_6 + run: | + pydocstyle --verbose --explain --count kyu_6 + - name: Doc style checking with pydocstyle for kyu_7 + run: | + pydocstyle --verbose --explain --count kyu_7 + - name: Doc style checking with pydocstyle for kyu_8 + run: | + pydocstyle --verbose --explain --count kyu_8 From 4e001d6e48d8eb9fed1ac50f18b4ef63c6055637 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:38:25 -0800 Subject: [PATCH 102/107] Update closest_elevator.py ./kyu_8/closest_elevator/closest_elevator.py:8:1: E302 expected 2 blank lines, found 1 def elevator(left: int, right: int, call: int) -> str: --- kyu_8/closest_elevator/closest_elevator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kyu_8/closest_elevator/closest_elevator.py b/kyu_8/closest_elevator/closest_elevator.py index 3a04743db19..74c694ee278 100644 --- a/kyu_8/closest_elevator/closest_elevator.py +++ b/kyu_8/closest_elevator/closest_elevator.py @@ -5,6 +5,7 @@ GitHub: https://github.com/ikostan """ + def elevator(left: int, right: int, call: int) -> str: """ Return closest elevator number. From 86d4a41c9bee5baa3f68a8d3d3b85fb3106cc01a Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:39:44 -0800 Subject: [PATCH 103/107] Update test_take.py ./kyu_8/enumerable_magic_25/test_take.py:65:27: E127 continuation line over-indented for visual indent n=n, ^ ./kyu_8/enumerable_magic_25/test_take.py:66:27: E127 continuation line over-indented for visual indent expected=expected, ^ ./kyu_8/enumerable_magic_25/test_take.py:67:27: E127 continuation line over-indented for visual indent result=actual_result) --- kyu_8/enumerable_magic_25/test_take.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kyu_8/enumerable_magic_25/test_take.py b/kyu_8/enumerable_magic_25/test_take.py index 97d7be1a043..7d94d7dee78 100644 --- a/kyu_8/enumerable_magic_25/test_take.py +++ b/kyu_8/enumerable_magic_25/test_take.py @@ -61,9 +61,9 @@ def test_take(self, arr, n, expected): f"expected output ({expected}) " f"vs actual result ({actual_result})"): - print_log(rr=arr, - n=n, - expected=expected, - result=actual_result) + print_log(arr=arr, + n=n, + expected=expected, + result=actual_result) self.assertEqual(expected, actual_result) From 47bab94c8e699dc8fc6ec8b1a3ab74a2fc8ec05a Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:41:12 -0800 Subject: [PATCH 104/107] Update README.md Error: kyu_8/closest_elevator/README.md:21 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md040.md --- kyu_8/closest_elevator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyu_8/closest_elevator/README.md b/kyu_8/closest_elevator/README.md index 51e1fa33e81..51c872ea4ac 100644 --- a/kyu_8/closest_elevator/README.md +++ b/kyu_8/closest_elevator/README.md @@ -18,7 +18,7 @@ You can assume that the inputs will always be valid integers between 0-2. ## Examples -``` +```bash left right call result 0 1 0 "left" 0 1 1 "right" From 3b68c84f0c506299190700416b6e1b98e9853978 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:50:41 -0800 Subject: [PATCH 105/107] Update lint_test_build_pipeline.yml --- .github/workflows/lint_test_build_pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint_test_build_pipeline.yml b/.github/workflows/lint_test_build_pipeline.yml index f2cd7abf847..087bb2a7562 100644 --- a/.github/workflows/lint_test_build_pipeline.yml +++ b/.github/workflows/lint_test_build_pipeline.yml @@ -33,6 +33,7 @@ jobs: - markdown - mypy - yamllint + - pydocstyle uses: iKostanOrg/codewars/.github/workflows/pytest.yml@master codecov: name: Codecov GitHub Action From c8b9a8d1bffcc3c2d03f5d6ac3a82637f64eccb0 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:54:38 -0800 Subject: [PATCH 106/107] Update lint_test_build_pipeline.yml --- .github/workflows/lint_test_build_pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint_test_build_pipeline.yml b/.github/workflows/lint_test_build_pipeline.yml index 087bb2a7562..8208a76196f 100644 --- a/.github/workflows/lint_test_build_pipeline.yml +++ b/.github/workflows/lint_test_build_pipeline.yml @@ -23,7 +23,7 @@ jobs: name: YAML Lint uses: iKostanOrg/codewars/.github/workflows/yamllint.yml@master pydocstyle: - name: PYDOCSTYLE Lint + name: PyDocStyle Lint uses: iKostanOrg/codewars/.github/workflows/pydocstyle.yml@master pytest: name: Unitest with pytest From 2f84a83a83ffe52bc8679deb14b84dc154e63673 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:56:01 -0800 Subject: [PATCH 107/107] Update markdown_lint.yml --- .github/workflows/markdown_lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/markdown_lint.yml b/.github/workflows/markdown_lint.yml index 64a623ac2da..e857a509871 100644 --- a/.github/workflows/markdown_lint.yml +++ b/.github/workflows/markdown_lint.yml @@ -1,5 +1,5 @@ --- -name: 'Markdown Lint' +name: Markdown Lint on: # yamllint disable-line rule:truthy push: