From 4cf8dd881c97c3fad14e4b7f670c5d702bcac597 Mon Sep 17 00:00:00 2001 From: Harish Kumar Rongala Date: Fri, 10 Apr 2020 19:41:55 +0530 Subject: [PATCH 01/91] Update solution.py --- .../functions/1-function1/Solution/solution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introduction_to_python/functions/1-function1/Solution/solution.py b/introduction_to_python/functions/1-function1/Solution/solution.py index aa5bb66..019027c 100644 --- a/introduction_to_python/functions/1-function1/Solution/solution.py +++ b/introduction_to_python/functions/1-function1/Solution/solution.py @@ -1,4 +1,4 @@ -# Code your solution here +# Code your solution heree def ranger(number): if number >=0 and number <=100: data="Hooray, Falls in my range" From f28fb8d92d5443104e32370f255ef0ee0be6c631 Mon Sep 17 00:00:00 2001 From: Harish Kumar Rongala Date: Fri, 10 Apr 2020 19:42:55 +0530 Subject: [PATCH 02/91] Update solution.py --- .../functions/1-function1/Solution/solution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introduction_to_python/functions/1-function1/Solution/solution.py b/introduction_to_python/functions/1-function1/Solution/solution.py index 019027c..aa5bb66 100644 --- a/introduction_to_python/functions/1-function1/Solution/solution.py +++ b/introduction_to_python/functions/1-function1/Solution/solution.py @@ -1,4 +1,4 @@ -# Code your solution heree +# Code your solution here def ranger(number): if number >=0 and number <=100: data="Hooray, Falls in my range" From c7b5e9e363b9c9c84f85b76938c91bb404246fe1 Mon Sep 17 00:00:00 2001 From: Harish Kumar Rongala Date: Fri, 10 Apr 2020 19:43:28 +0530 Subject: [PATCH 03/91] Update solution.py --- .../functions/1-function1/Solution/solution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introduction_to_python/functions/1-function1/Solution/solution.py b/introduction_to_python/functions/1-function1/Solution/solution.py index aa5bb66..019027c 100644 --- a/introduction_to_python/functions/1-function1/Solution/solution.py +++ b/introduction_to_python/functions/1-function1/Solution/solution.py @@ -1,4 +1,4 @@ -# Code your solution here +# Code your solution heree def ranger(number): if number >=0 and number <=100: data="Hooray, Falls in my range" From 6f1747f575daa340f3803afa74f423804e2a0f19 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 11 Apr 2020 13:57:57 -0400 Subject: [PATCH 04/91] Add gitignore file --- .gitignore | 1 + introduction_and_environment/README.md | 14 ++++----- .../1_compuare_check/README.md | 17 ++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 260 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1581 bytes .../1_compuare_check/Solution/solution.py | 5 +++ .../Solution/test_solution.py | 15 +++++++++ .../1_even_odd/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 298 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1477 bytes .../1_even_odd/Solution/solution.py | 7 +++++ .../1_even_odd/Solution/test_solution.py | 20 ++++++++++++ .../1_loop_divisible/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 345 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1324 bytes .../1_loop_divisible/Solution/solution.py | 11 +++++++ .../Solution/test_solution.py | 14 +++++++++ .../1_string_convert/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 322 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 2060 bytes .../1_string_convert/Solution/solution.py | 9 ++++++ .../Solution/test_solution.py | 21 +++++++++++++ .../1_string_length/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 260 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1486 bytes .../1_string_length/Solution/solution.py | 4 +++ .../1_string_length/Solution/test_solution.py | 18 +++++++++++ .../1_string_slice/README.md | 19 ++++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 308 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1629 bytes .../1_string_slice/Solution/solution.py | 6 ++++ .../1_string_slice/Solution/test_solution.py | 13 ++++++++ .../2_add_item/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 310 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 628 bytes .../2_add_item/Solution/solution.py | 4 +++ .../2_add_item/Solution/test_solution.py | 13 ++++++++ .../2_append/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 271 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1072 bytes .../2_append/Solution/solution.py | 4 +++ .../2_append/Solution/test_solution.py | 13 ++++++++ .../2_except_letter/README.md | 14 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 315 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1076 bytes .../2_except_letter/Solution/solution.py | 11 +++++++ .../2_except_letter/Solution/test_solution.py | 14 +++++++++ .../2_farm_area/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 293 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1807 bytes .../2_farm_area/Solution/solution.py | 8 +++++ .../2_farm_area/Solution/test_solution.py | 24 +++++++++++++++ .../2_remove_item/README.md | 12 ++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 284 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1073 bytes .../2_remove_item/Solution/solution.py | 4 +++ .../2_remove_item/Solution/test_solution.py | 14 +++++++++ .../2_sum_list/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 280 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1071 bytes .../2_sum_list/Solution/solution.py | 4 +++ .../2_sum_list/Solution/test_solution.py | 13 ++++++++ .../2_vowel_consonant/README.md | 17 ++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 336 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1292 bytes .../2_vowel_consonant/Solution/solution.py | 7 +++++ .../Solution/test_solution.py | 21 +++++++++++++ .../3_count_duplicate/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 288 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1074 bytes .../3_count_duplicate/Solution/solution.py | 4 +++ .../Solution/test_solution.py | 13 ++++++++ .../3_grade/README.md | 22 +++++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 395 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1472 bytes .../3_grade/Solution/solution.py | 14 +++++++++ .../3_grade/Solution/test_solution.py | 21 +++++++++++++ .../3_month_days/README.md | 19 ++++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 448 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1480 bytes .../3_month_days/Solution/solution.py | 8 +++++ .../3_month_days/Solution/test_solution.py | 20 ++++++++++++ .../3_palindrome/README.md | 16 ++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 367 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1499 bytes .../3_palindrome/Solution/solution.py | 9 ++++++ .../3_palindrome/Solution/test_solution.py | 20 ++++++++++++ .../3_set_diff/README.md | 20 ++++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 352 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1073 bytes .../3_set_diff/Solution/solution.py | 6 ++++ .../3_set_diff/Solution/test_solution.py | 11 +++++++ .../3_shape_check/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 456 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1239 bytes .../3_shape_check/Solution/solution.py | 18 +++++++++++ .../3_shape_check/Solution/test_solution.py | 20 ++++++++++++ .../3_string_case/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 308 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1294 bytes .../3_string_case/Solution/solution.py | 5 +++ .../3_string_case/Solution/test_solution.py | 23 ++++++++++++++ .../data_types_and_control_flow/README.md | 26 +++++++++++++--- .../hello_world/1_concatenate/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 288 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1371 bytes .../1_concatenate/Solution/solution.py | 5 +++ .../1_concatenate/Solution/test_solution.py | 16 ++++++++++ .../hello_world/2_capture_display/README.md | 14 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 253 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1536 bytes .../2_capture_display/Solution/solution.py | 5 +++ .../Solution/test_solution.py | 24 +++++++++++++++ .../hello_world/2_string_duplicate/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 275 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1515 bytes .../2_string_duplicate/Solution/solution.py | 6 ++++ .../Solution/test_solution.py | 24 +++++++++++++++ .../hello_world/2_type_check/README.md | 17 ++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 317 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 2109 bytes .../2_type_check/Solution/solution.py | 5 +++ .../2_type_check/Solution/test_solution.py | 29 ++++++++++++++++++ .../hello_world/3_type_change/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 320 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1928 bytes .../3_type_change/Solution/solution.py | 8 +++++ .../3_type_change/Solution/test_solution.py | 16 ++++++++++ .../hello_world/README.md | 17 ++++++---- .../functions/1_default_args/README.md | 18 +++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 381 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 631 bytes .../1_default_args/Solution/solution.py | 6 ++++ .../1_default_args/Solution/test_solution.py | 13 ++++++++ .../functions/1_range/README.md | 14 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 419 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1232 bytes .../functions/1_range/Solution/solution.py | 10 ++++++ .../1_range/Solution/test_solution.py | 21 +++++++++++++ .../functions/1_return_hello/README.md | 16 ++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 373 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1238 bytes .../1_return_hello/Solution/solution.py | 7 +++++ .../1_return_hello/Solution/test_solution.py | 20 ++++++++++++ .../functions/2_max_value/README.md | 17 ++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 491 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1694 bytes .../2_max_value/Solution/solution.py | 16 ++++++++++ .../2_max_value/Solution/test_solution.py | 26 ++++++++++++++++ .../functions/2_shut_down/README.md | 18 +++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 486 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1742 bytes .../2_shut_down/Solution/solution.py | 12 ++++++++ .../2_shut_down/Solution/test_solution.py | 20 ++++++++++++ .../functions/2_variable_argument/README.md | 15 +++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 415 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 636 bytes .../2_variable_argument/Solution/solution.py | 10 ++++++ .../Solution/test_solution.py | 14 +++++++++ .../functions/3_anonymous/README.md | 20 ++++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 526 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 628 bytes .../3_anonymous/Solution/solution.py | 7 +++++ .../3_anonymous/Solution/test_solution.py | 12 ++++++++ .../functions/3_count_even/README.md | 16 ++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 500 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1074 bytes .../3_count_even/Solution/solution.py | 9 ++++++ .../3_count_even/Solution/test_solution.py | 13 ++++++++ .../functions/3_factorial/README.md | 18 +++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 405 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1226 bytes .../3_factorial/Solution/solution.py | 11 +++++++ .../3_factorial/Solution/test_solution.py | 21 +++++++++++++ .../functions/3_total/README.md | 18 +++++++++++ .../__pycache__/solution.cpython-37.pyc | Bin 0 -> 418 bytes .../test_solution.cpython-37-pytest-5.3.5.pyc | Bin 0 -> 1110 bytes .../functions/3_total/Solution/solution.py | 10 ++++++ .../3_total/Solution/test_solution.py | 14 +++++++++ introduction_to_python/functions/README.md | 16 ++++++---- 180 files changed, 1516 insertions(+), 24 deletions(-) create mode 100644 .gitignore create mode 100644 introduction_and_environment/data_types_and_control_flow/1_compuare_check/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/1_compuare_check/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_compuare_check/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_compuare_check/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_compuare_check/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_even_odd/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_loop_divisible/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_convert/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_length/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_slice/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_add_item/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_append/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/2_append/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_append/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_append/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_append/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_except_letter/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_farm_area/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_remove_item/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/2_remove_item/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_remove_item/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_remove_item/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_remove_item/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_sum_list/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/2_sum_list/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_sum_list/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_sum_list/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_sum_list/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_vowel_consonant/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/2_vowel_consonant/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_vowel_consonant/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/2_vowel_consonant/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/2_vowel_consonant/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_count_duplicate/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/3_count_duplicate/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_count_duplicate/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_count_duplicate/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_count_duplicate/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_grade/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/3_grade/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_grade/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_grade/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_grade/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_month_days/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/3_month_days/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_month_days/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_month_days/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_month_days/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_palindrome/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/3_palindrome/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_palindrome/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_palindrome/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_palindrome/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_set_diff/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/3_set_diff/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_set_diff/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_set_diff/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_set_diff/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_shape_check/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/3_shape_check/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_shape_check/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_shape_check/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_shape_check/Solution/test_solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_string_case/README.md create mode 100644 introduction_and_environment/data_types_and_control_flow/3_string_case/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_string_case/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/data_types_and_control_flow/3_string_case/Solution/solution.py create mode 100644 introduction_and_environment/data_types_and_control_flow/3_string_case/Solution/test_solution.py create mode 100644 introduction_and_environment/hello_world/1_concatenate/README.md create mode 100644 introduction_and_environment/hello_world/1_concatenate/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/hello_world/1_concatenate/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/hello_world/1_concatenate/Solution/solution.py create mode 100644 introduction_and_environment/hello_world/1_concatenate/Solution/test_solution.py create mode 100644 introduction_and_environment/hello_world/2_capture_display/README.md create mode 100644 introduction_and_environment/hello_world/2_capture_display/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/hello_world/2_capture_display/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/hello_world/2_capture_display/Solution/solution.py create mode 100644 introduction_and_environment/hello_world/2_capture_display/Solution/test_solution.py create mode 100644 introduction_and_environment/hello_world/2_string_duplicate/README.md create mode 100644 introduction_and_environment/hello_world/2_string_duplicate/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/hello_world/2_string_duplicate/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/hello_world/2_string_duplicate/Solution/solution.py create mode 100644 introduction_and_environment/hello_world/2_string_duplicate/Solution/test_solution.py create mode 100644 introduction_and_environment/hello_world/2_type_check/README.md create mode 100644 introduction_and_environment/hello_world/2_type_check/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/hello_world/2_type_check/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/hello_world/2_type_check/Solution/solution.py create mode 100644 introduction_and_environment/hello_world/2_type_check/Solution/test_solution.py create mode 100644 introduction_and_environment/hello_world/3_type_change/README.md create mode 100644 introduction_and_environment/hello_world/3_type_change/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_and_environment/hello_world/3_type_change/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_and_environment/hello_world/3_type_change/Solution/solution.py create mode 100644 introduction_and_environment/hello_world/3_type_change/Solution/test_solution.py create mode 100644 introduction_to_python/functions/1_default_args/README.md create mode 100644 introduction_to_python/functions/1_default_args/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/1_default_args/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/1_default_args/Solution/solution.py create mode 100644 introduction_to_python/functions/1_default_args/Solution/test_solution.py create mode 100644 introduction_to_python/functions/1_range/README.md create mode 100644 introduction_to_python/functions/1_range/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/1_range/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/1_range/Solution/solution.py create mode 100644 introduction_to_python/functions/1_range/Solution/test_solution.py create mode 100644 introduction_to_python/functions/1_return_hello/README.md create mode 100644 introduction_to_python/functions/1_return_hello/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/1_return_hello/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/1_return_hello/Solution/solution.py create mode 100644 introduction_to_python/functions/1_return_hello/Solution/test_solution.py create mode 100644 introduction_to_python/functions/2_max_value/README.md create mode 100644 introduction_to_python/functions/2_max_value/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/2_max_value/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/2_max_value/Solution/solution.py create mode 100644 introduction_to_python/functions/2_max_value/Solution/test_solution.py create mode 100644 introduction_to_python/functions/2_shut_down/README.md create mode 100644 introduction_to_python/functions/2_shut_down/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/2_shut_down/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/2_shut_down/Solution/solution.py create mode 100644 introduction_to_python/functions/2_shut_down/Solution/test_solution.py create mode 100644 introduction_to_python/functions/2_variable_argument/README.md create mode 100644 introduction_to_python/functions/2_variable_argument/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/2_variable_argument/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/2_variable_argument/Solution/solution.py create mode 100644 introduction_to_python/functions/2_variable_argument/Solution/test_solution.py create mode 100644 introduction_to_python/functions/3_anonymous/README.md create mode 100644 introduction_to_python/functions/3_anonymous/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/3_anonymous/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/3_anonymous/Solution/solution.py create mode 100644 introduction_to_python/functions/3_anonymous/Solution/test_solution.py create mode 100644 introduction_to_python/functions/3_count_even/README.md create mode 100644 introduction_to_python/functions/3_count_even/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/3_count_even/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/3_count_even/Solution/solution.py create mode 100644 introduction_to_python/functions/3_count_even/Solution/test_solution.py create mode 100644 introduction_to_python/functions/3_factorial/README.md create mode 100644 introduction_to_python/functions/3_factorial/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/3_factorial/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/3_factorial/Solution/solution.py create mode 100644 introduction_to_python/functions/3_factorial/Solution/test_solution.py create mode 100644 introduction_to_python/functions/3_total/README.md create mode 100644 introduction_to_python/functions/3_total/Solution/__pycache__/solution.cpython-37.pyc create mode 100644 introduction_to_python/functions/3_total/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc create mode 100644 introduction_to_python/functions/3_total/Solution/solution.py create mode 100644 introduction_to_python/functions/3_total/Solution/test_solution.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c18dd8d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/introduction_and_environment/README.md b/introduction_and_environment/README.md index 159a53f..7e3057c 100644 --- a/introduction_and_environment/README.md +++ b/introduction_and_environment/README.md @@ -1,8 +1,8 @@ -# Exercise Organization +# Exercises for Hello World -## Exercise Sections -* UNIX and Bash -* Data Types and Control Flow -* git -* Introduction to Programming -* Hello World +* 1_Arithmetic +* 1_Name_Bindings +* 1_Operators +* 2_Python_Caches +* 2_String_Arithmetic +* 3_User_Input diff --git a/introduction_and_environment/data_types_and_control_flow/1_compuare_check/README.md b/introduction_and_environment/data_types_and_control_flow/1_compuare_check/README.md new file mode 100644 index 0000000..6436eda --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_compuare_check/README.md @@ -0,0 +1,17 @@ +# Compare Check + +## Motivation +Python provides == operator to check if the object on LHS and RHS hold similar values. + +!= for not equal values. + +## Problem Description +Write a python script that contains 2 integers `x` and `y` variable values whos contents is hidden from you. +Create a variable `result` to check if x and y hold same values or not. +Print the boolean result . + +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/1_compuare_check/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/1_compuare_check/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b5abe85ac8c5a57ac11a705690e30f5fe17e4f6 GIT binary patch literal 260 zcmXw!&q~8U5XN`5u@<3k;0qL4!K;X-EWtj(kfs5tZ(}<0p|pF literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_compuare_check/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/1_compuare_check/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a90c57eb9f221e8340bf72952a226a1b9abc578 GIT binary patch literal 1581 zcmb_cO>f&a7$zxMmL1z&lcMNuL4geu1{+J4kD+LaW=Rga1OwV#3}J$5GKp(_fuvVE zl`d`3Ww-u-9pc{BbAQD44+dVhOKv;ow3n2<%0SW61n|}S$@k&ISNgWyZoc{Q`H#0T zLVuykLqLB3OMDK3B8nr_$L399iy(|*yI;eI5^B9feTU+Q$g?jY7aa{?FY`1()?rz& z#NXhh=oj=eI>r=J^3pAEjxG?jay%ojlTA^C3zCy3q_AkMuyZT7N2I9bHStDT7dCbB z8r0Uc|Cr2d>dM-MGeaXsP>9!aGQ&Ip&DB~$Ag*<5hRxfaVcPiBx`_&hHt9<43^C|+ z*??#>ug~xc{2Webqr!rv`;#XtfTUGL@*0aCl~Gg z0FFN^I66AA%n4-V3nZ^GfAt|O^xA?!$bPG{&(RD+_B)-ebzt!t{lu{5((80JcMWTe zIctq7YekJBn1Z$U1E2>%uQfdYE{Gfkz$D?L-;jsvb*cyGw-u6vgsX9G@s3t_1$%?edUSXq*<)* zmgbfxl)FISS;~S8E$(Qsb=C<5@E}d)4y1x}=kgEJ=c65_OC11C?;~(H6XQs}uh{ei z*WavX@dmuO{*HC$%_TV7C7f-qt?GiwP)g4A9V zcR?V(0S@(PP*UD2&jd8|ID5*666pKSrRsAZUxga8lR;Y%2C#cChHook_YGFaM1{nz|W}M~u*)eZH)zf2Uy&LE?(&kEs9y-m{(;0)%0Q%7SVWdP;}R s*7;p+H~KVBX>tmq=eF*WN&A0s(r)AMqM>IsT&Da!B^mJpJ`jrk0>2Sc;{X5v literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66495a0d02dd84bbe6c42156b5fe1b3a85a73d8f GIT binary patch literal 1477 zcma)6&2JM&6rb5$uQ!fkNRSXnsLG`kTVadvEkqC$f>a5mm1ujgR;)Ijak6B;G&3f# zSziEwx$y^Zh%ZRo_+xsSYcKR);MDhK?Z{E3mbLcndvAX8=J!6vKdr1ZCbwQbJ*0&E zMHU_l^n38iA3!j|XhOQwe67^B2qmf0tx>`(X1^v~m(eH0cm4(}+3rCs^LQZZ@Y?Xo zH{fOT9mIG?-qJobJH0V|OF(y6?X@?yN^(S)ThggTiP7t&g*x*XN$A)v?Pu25DV+)3 zx5l-yCjV6Sk;9hC8pLRzzi&+)wybJL?v(7ivV`?|X-}zm1Dc0gX2Ck@&Xls|G4dlK zClrvMaTPT{HrdJt`z#r|ti?{1ZcIV1t0h1*%KDVPqAwvIhm0LyV?SFq+(^akJ(VNC z&Dos>cH|^GKzxU%BCGdQT*Pz##c*}b5YUeiJs}4D2cl62maE^+k`d_B+IIW}`r9*2 znhEUL8SIk-VuC2T{fP)11D|SoXtb|`2e*UYB^NTd&(b&x9&)*_@*>FiLDF+GSsMfXfaSjq&{op_{rcxr&q$0`t~xMMpR86+=_&Na)oNikyUk7owM^MI^Xx!g4sT zfOe}k=yRdm%LfTF&~P`&ccLWBqLk~UP)2=@5p?Um;SSB-5+WD+OxVvw8mW*U7D<#v zI0o85y1u8E(>&Yf!y;0>J%NKD@K2?px{MsELTu;-<7(F!Rn+T?#?5K~ER(t^ZPoLY z6H|qqlRttW)S-^mbl^vumPcLU!G+%=P0}Kj<&wf!;sT)ky7uNJ5o_Sk=fkRqor)zS r))D+b#0m;>?9%m_Pn?E5CQ>zyIPwdF>D@`;Y9;)x;fJ&8ku~xU9Y literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/solution.py b/introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/solution.py new file mode 100644 index 0000000..952fb8e --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/solution.py @@ -0,0 +1,7 @@ +# Code your solution here +number=int(input()) +if (number%2)==0: + data="Even" +else: + data="Odd" +print(data) \ No newline at end of file diff --git a/introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/test_solution.py b/introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/test_solution.py new file mode 100644 index 0000000..3c17606 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_even_odd/Solution/test_solution.py @@ -0,0 +1,20 @@ +def test_solution(monkeypatch): + x=744 + ret_val1= None + + def f(): + nonlocal x + return x + + def g(num1): + nonlocal ret_val1 + ret_val1=num1 + + monkeypatch.setattr('builtins.input',f) + monkeypatch.setattr('builtins.print',g) + + import solution + assert solution.number==x + + + diff --git a/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/README.md b/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/README.md new file mode 100644 index 0000000..9f72426 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/README.md @@ -0,0 +1,15 @@ +# Loop Divisible + +## Motivation +Generate sequence of numbers which are divisible for 5 and 7 , having a limit range of upto 50. + +## Problem Description +Write a Python script that declares a variable `x` containing value hidden from you. +Construct a loop to run upto length of `x` to retrieve values which are divisible by 5 and 7 , store the result values in `data` variable. +Print the result. + +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5ac48fd5553384793d6520db0c88eecc0fa7ba4 GIT binary patch literal 345 zcmX|*&q@O^5XLjR*(%b4hax_LJ*=Py4^l*J6@(%}6`@3BZH5}UO}0t;?`mH}@gTlZ zuAce|o}3kR;QP(@!OSqHwb}-wdTT!4zf=D#!(VYS$0XMwNY-Nm)`R&0MiP)Mqc*$S z>BSh!Xp6~s7}+{`{_o+1WBdxh#`SUimSKXhq$HCrYgAVIbaDkHk`g4gS|eOGDgow! z%gkpXv6&uV02L}(QJ|I~DXh}|gV`$0{@`ocIuth!trI75q_k+G8+ua+jkAZo(H^xI z7us7RCw;GsPOnXRweU|yi?cb}zH;b9iw3R9)AQWS#9rDlrbydrs+@YvQFKi{DOZL2 cHM_+ktT#t=GRLEcUUB6=95`&kHdG@H-wb?Ri2wiq literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08d3ea0b0c1b457591689476c445c421cfb9b07d GIT binary patch literal 1324 zcma)6O>fgc5Z$#M$4Qe=sDwb`&*->~QaZpyB%GZ)zb!Zo)7t8bXkntT6d z*qAZ|^pZw@Mh3mA(b@-=jsIs!5a@Af^LPI8=;EkYM1dmA?XTb&)yOQNWM)$)m%OuTY@H~^8k$zXkENi}I z&6fk&V_ER@fbwoEs0h{p$XU{SmazR`q4|QbytxtY#Ukz`Gh}>@!)q7w%L(g7iCArI4;!6+oX9v6t(?bjm2T9>C)Ub}kB9!v+xcM87uCa4 zXMSZ~dv|@&I;f83S0>?-FO)aET;YLlD;q%CENZhfY(xSEAXS%D z7p~xrrdCsBL1iQ*=UNJd4^(w6ADI3kt}chrSQ2uY^DayCh*MRAbU5u&xs%q_wNUg} zKOqJhZYQi0C1Dn&R8>L|ZBbo8H69zsEymMGhV&p$qAb#*SB_@tduk?S z*)ARAk?i((1-Nln8^dx&bC}FvL7fZkwM{UodjEXz(7Z!FHeGYArK(>LQ43}MWe|3- zW7X`Mgta#3y~egp7+S$We*@GH9J^>8w~)`T4N)8cfW#}ejnwx!Ca edwdqom`aA-Ib#TV%PG9e30*bZv|Jv#g8l$Z*=t|` literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/solution.py b/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/solution.py new file mode 100644 index 0000000..d662c2c --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/solution.py @@ -0,0 +1,11 @@ +# Code your solution here +x=50 +data=[] +for i in range(1,x): + if (i%5)==0 and (i%7)==0: + data.append(i) + else: + pass +print(data) + + \ No newline at end of file diff --git a/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/test_solution.py b/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/test_solution.py new file mode 100644 index 0000000..4affda4 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_loop_divisible/Solution/test_solution.py @@ -0,0 +1,14 @@ +def test_solution(monkeypatch): + y=50 + ret_val1= None + + def g(num1): + nonlocal ret_val1 + ret_val1=num1 + monkeypatch.setattr('builtins.print',g) + + import solution + assert solution.x==y + + + diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_convert/README.md b/introduction_and_environment/data_types_and_control_flow/1_string_convert/README.md new file mode 100644 index 0000000..2b0085d --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_string_convert/README.md @@ -0,0 +1,15 @@ +# String Convert + +## Motivation +By default the input() keyword captures data in a string format unless we try to explicitly type cast. + +## Problem Description +Write a Python script that asks the user for a string value stored in object `string`. +Your goal is to check whether the value is in upperCase ,if so convert the data into lowerCase else if value is in lowerCase , convert the data into upperCase and store the result in `data` variable. +Print the result. + +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d8bb9fdb80fbbd53aeb72b126fca2508b27e50e GIT binary patch literal 322 zcmXv~u}%Xq3{Bd*>rvE&iC<`?Ah9qYKtKVB1tA?QRRpT;EQq)!QQ~Xq+WrU~`%78* z3nrYSShC;qi(^~99t`@7Z2x@qvL*bE$-i}oT$1|}3c%KE!hwHvHq0Fob~kL2=mTOY zDI>zHRT%UjS#!=RRVPOKYI5U!>3_j literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e73470433bc45ec9673bceff088cc5036b6a5c9e GIT binary patch literal 2060 zcmah~OK;mo5Z4&$Qnq4>Bz9M^ zrBFbT28eU>v46y(uCCp&C*Q9ANdO&LCJBTIwZOEm6^B`>) zIT#{&Q zD4&?mjgggD=k&xF*@-=J5?jQ2wvZGOoGm6rm~}3w_(SF{O;${7s8PZ-9b;^=vdmvv zV{&4NOYqx?Ii?&V9n?Yt{HR-F$|_fpe`4f0g~-3qiyA~$SoPQ3A{mv~44X|#T?%?R z$zK+d@|Xe#8!-F?@ra=a80HY+bqo-38*^jr3(D6p`!yT|z%f6;0nyKNG}MRaA9Zw! zWu7f)EERTxeUwx*ma4{5MJy0mO!91TY;*~roM9icrDR4&&B_vZ%gOAR{!CxN4w+=+ zz{ta}VAwDU&{gw!1^S;qC(vWqfeS-medJ~Vx0~qs7dJzg5Rq~-cop>P-15Nf))hBH zAbb0q05^m0U^ME`=UeO(&25f-%05fxH0n}@x-^A4Ke8Bs)A;#*(|Nl8_}Si*gT1EH z54$gXF8sDWnVGG47=4C68FYExS>;@_n@O-9R2kVQcTq=k2cWMe891@+eq&6hx=3#>#=@ z-SB7yW&xFK9YjGNm$sxYq$@J39uE}lSO^dy5o5S?-MYb}Qhm@{pIbbAk z*K|MVenzZmhW%ax2s+%C?h7wyXa~n8D0)A_Bfj$EsS930Ge&BLH=Iy8#d)!xLaJ!S8QC509)RHTXqkh12sCyJd zhhE@@Ue8wrS9l#CGbqc8V?Si7>UJXD^Q3ziML`s+>I2Ok4(A@{5myTnzke17Ug+Vm zRVI?H&8t!`3Qzn&?8){quOP)d3j7G9JW2>KCEQR`#+_+nW7=3vNo8vqO-(Vg?lg6Z z6!6_?V>?}ydKw$)s?553&Dxr_)>fyJY@`>)&>N?ZVtPj^*KQ%65b+2Ep(g%~vI&1$ zHXLdai#YHmojfgaOv}-zTfHgW(dbRQOF?GqEogTcb0{@=Ij`!Xn^W-1L!!K$8 literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/solution.py b/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/solution.py new file mode 100644 index 0000000..ccc0730 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/solution.py @@ -0,0 +1,9 @@ +# Code your solution here +string=input() +if string.islower(): + data=string.upper() +elif string.isupper(): + data=string.lower() +else: + pass +print(data) diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/test_solution.py b/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/test_solution.py new file mode 100644 index 0000000..0054635 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_string_convert/Solution/test_solution.py @@ -0,0 +1,21 @@ +def test_solution(monkeypatch): + x='UNIVERSE' + y='universe' + ret_val1= None + + def f(): + nonlocal x + return x + + def g(num1): + nonlocal ret_val1 + ret_val1=num1 + + monkeypatch.setattr('builtins.input',f) + monkeypatch.setattr('builtins.print',g) + + import solution + assert solution.string==x or solution.string==y + + + diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_length/README.md b/introduction_and_environment/data_types_and_control_flow/1_string_length/README.md new file mode 100644 index 0000000..fc518c6 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_string_length/README.md @@ -0,0 +1,15 @@ +# String length + +## Motivation +Python provides inbuilt keyword len() used to retrieve the length of any data type. + +## Problem Description +Write a Python script that asks the user for a string_value and store it object `string_1`. +Find the length of the string and store the result in `data` variable. +Print the result. + +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b834db5897e751c429c2439819df343da4e65d93 GIT binary patch literal 260 zcmXv}%WA_w4BUD4TY zS&hEsm=lK@_uF|)8o-!VJKn|2%Z^VfjK%0ozw~r#-v|QPhw50PT>^cu^A_QATRLPw zwlB!RRc*<&L$h|~wc~?B`}_r=tO>|2#oVkrFLG{*bFh)rJs)i0ns&IebP+eci}~GA P{2EvcpHV6_*17%zZbwY? literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc37c2a2317588a2f9352fc0631294e818f7458b GIT binary patch literal 1486 zcma)6&5PSc6rYh~S?l#W-2}pxLfK18RALjS`GAsLk~V<`!cy3@2O}aB&)8O0U(Adf z+mSEnvf1472lTMM6iP4sV{)2nPW=~h>U$%5@lt3jqo?=r)0^M>kiXs9YW#8i^|J{j ztPOnA@vzUEMdM=}f#CQGzEIH^yE^~Px>u}p} z%MFi%dnqk zif1Z#oGFpBabLxG)_$6|f0(LKo&}F4T=ZkfW$-XkQTyq%0JYmbR3grX?SyATH3|;% zWQ^|xic1yBrPV2>nhsoKhkS@N+qoFO2gO8*-0uv|w-4(%uL)PNgv~Sc(}QJIJtrHd zU8v3zT!lYJN!J7fc0ki%10Mf%-f-4>K8_O=XR;G##aOM`1r(+Pa`5R#Yj4k|vm0Mr zE2cMn*?6^7cK3EsyWz`@G>r(mjrs0g<-O%g?X7ws@H6slZ37y`O%%6gtw_Q+l*w`j z@Zh`y2VMV{gBY~`!XW}X>o;{>auq2h#0JV zZbCR*bwRt;DD+M!NBKBm1{w~N{CSjwS(I|U5z1)5F@tVBFzjLAkA%pDz7h^{kwz-y zlOl<-2v&D$`2`p2* zX>K+5tqYrl>n6VfL8wC=tLeaxHZ703#Dgz?M4F^UD$6B>vBYP9_UqbPwM1-#Lw_1p xP3%-Gp|FnNFGZ}NA?Ge#U;4x)c*kU_RuXxvEvI)cg)c1O`-UIxt4A)AzX2H!j}ia? literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/solution.py b/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/solution.py new file mode 100644 index 0000000..3cbc247 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/solution.py @@ -0,0 +1,4 @@ +# Code your solution here +string_1=input() +data=len(string_1) +print(data) diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/test_solution.py b/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/test_solution.py new file mode 100644 index 0000000..04640fa --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_string_length/Solution/test_solution.py @@ -0,0 +1,18 @@ + +def test_solution(monkeypatch): + x='Hello' + ret_val1= None + + def f(): + nonlocal x + return x + + def g(num1): + nonlocal ret_val1 + ret_val1=num1 + + monkeypatch.setattr('builtins.input',f) + monkeypatch.setattr('builtins.print',g) + + import solution + assert solution.string_1==x \ No newline at end of file diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_slice/README.md b/introduction_and_environment/data_types_and_control_flow/1_string_slice/README.md new file mode 100644 index 0000000..f9e8733 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_string_slice/README.md @@ -0,0 +1,19 @@ +# String Slice + +## Motivation +Strings are sequential, immutable, collections of zero or more letters, numbers and other symbols. We call these letters, numbers and other symbols characters. String values are differentiated from identifiers by using quotation marks (either single or double). + +The operations on Lists and strings are exactly the same EXCEPT that strings are immutable and cannot be modified. To modify a string, the .replace() method must be used an must be set to another variable + +## Problem Description +Write a python script that contains a `string_value` variable holding data "Hello universe" +Perform slicing of "Hello" from `string_value` variable and store the result in `data` variable. +Concatenate `data` variable with string value "World" and store result in another variable `data_val`. +Print the result data. + + +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..492f7a9156088192b5d7f7610a0c2d42f4e422cb GIT binary patch literal 308 zcmXwz&q@O^5XL9jT`i^cD&9PJDY$}H5%Et2y@;?a!V)aYX3$`oEJ?Pyo<#9se5JkW zrLW-0*-{7cn=cu@FLOQ|_JQhW|NZ`r`geEvuZYAc9luAAkOP8bl7I3Y$Qd#jZ9~p6 zLjJ)R$T)*h^15|}THD>JQ44e)m*j+HLdcUl>$JQX#qGccr_94_QRo`mSQepZ`yJOW zNk!xE1#XjkEBv~PBQf=qD9+?u88Jrx6l^67KF>;P0-7MMO>kD$Wl+|n6Pw;P;n5m# z`GT%g9=#aT7wM#_NFJuyYKJt_szi}lU3WI&*W#dR+TQV;;xwLcTElM;Vm4qs_6Ny6 BS`PpK literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..947223e7240002c66d7ce30478a0b49261f0e601 GIT binary patch literal 1629 zcmb_cOK;mo5Z>iW6fMbd3>4|5@TElwR6^|d5d?7%w+YZ*i~>$B0#Sm|u5HGAVRscr zDhUKh(5AQifF7*e(sO@IvDfy}ThBgqb}6+~5j2+&*x|f(=G$+F{Ic8ip7o!9cYqQ4 z9W@>U^t-V5XCMe7I6*_K-$rU02&2>*+87aom@m=LA@~US)}N4z4o6T+KOV>yEE5+0 z1H1(NgnmTFm|$YObSqq<3q;Hk&kU$!5tQJ{D2>NPWfHrxO0%@ijLI%;{zjM=7I8`& z_O_J&*qB+w750TQLuU>r5O0;n46_V0S8166aiyCxtl!oQllIT%N2qd$M^;KF#-O)E z8=_v>n&B7tIh@c!l?hArHy*D5l1>xJYs?3bzrfOc2bRAeUSqk`eLobIPGy$nD^xQA zIDTv3=&8suCy-Gtki5q1hj(Eis|yAp`xlk{3e7NN|EjW;4lJ&cE1ETztdXmwt66K$ zS!*|0t89W`3fBJ}05u3|t*ZfWL6k56Itd@XMLr%{**M+wv2+;~;gcxYWNPj%&%e4A zJmi$|;DDrY7Tlx!Oyot7(erSWXM$!T_$Cu9C*zTb^Q`|M?|(ZHr+F6Ke@fXX=9CBb zA`$f;ObSpp`$vMs*-8H>iAOXz%9F9$76{5k$miCem`HqLE2s(tGN#v-#JyXM9jVUBT2Lr@gOflH?l?v-k->r#`+k_V;}}-Tw6RVzT9P@B6v3vA?0T z>pmZFjY}PUOucGjzmDwqT)GQfz9~&eR$@zuooO%PK#tHw_8=9UdqZ1yhjw55Pdfsf zEVY6Bt@q^r7u>ebnfjuAlc_6ZZ4e5=_7bk$8rQDhl`T$1Bm`sXUoh-6k1V~r#YD3l zF}W53y-CPu!A5ynM2yM~gu?~b(y1>%UJLnYK2C^E4NsE%QIv#Plv3Fad2~!w1=%~$ zB*8V`XDnxOJv`1?8i|lTEs`jU)Bs3J5i<0YtdHq?awW~PGdd|EF*;>x95imZqM+2o zZ#IqXrg5V->Q1{&YyI#%x$M(yU0O>jL10s literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/solution.py b/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/solution.py new file mode 100644 index 0000000..9c01912 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/solution.py @@ -0,0 +1,6 @@ +# Code your solution here +string_value="Hello Universe" +data=string_value[0:5] +data_value=data+"World" +print(data_value) + diff --git a/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/test_solution.py b/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/test_solution.py new file mode 100644 index 0000000..c7da117 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/1_string_slice/Solution/test_solution.py @@ -0,0 +1,13 @@ + + +def test_solution(monkeypatch): + ret_val1=None + def g(num1): + nonlocal ret_val1 + ret_val1=num1 + + monkeypatch.setattr('builtins.print',g) + + import solution + assert solution.string_value=="Hello Universe" + assert solution.data=="Hello" \ No newline at end of file diff --git a/introduction_and_environment/data_types_and_control_flow/2_add_item/README.md b/introduction_and_environment/data_types_and_control_flow/2_add_item/README.md new file mode 100644 index 0000000..d8cfd79 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_add_item/README.md @@ -0,0 +1,15 @@ +# Add Item + +## Motivation +Dictionary is a collection of ordered or unordered key:value pairs. + +## Problem Description +Write a python script that contains a `dict_a` dictionary variable holding a set of key:value pairs hidden from you. +Your objective is to add a new key:value pair to th existing dictionary set and store insdie variable `dict_val`. +Print the result. + +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b770a58193433b7ffb59476f562e983593c8029b GIT binary patch literal 310 zcmXv~%}T^D5Kh`|U6!qnA?%@ot0xh0bv>*H5xQPVa0#7&!8VD>bhRG!0ek@udi0fY z^({P^t~xN^d>_O7@SSGah=ja5{p!VkB!QfSbUOin0EGzRx40yNyi-VEAn6A! zBN2<}g;D}(K_**1z3T8*D<2p4wI5yZHFuSj1}Cwnd!9}`-S_msCw=E~lK2#4g)8pU z)&NIQ4mWzuYdYm=s?rLDLbgz7HMA8< zt@5SLfB#|UkHS{c3CHFfdA{sSpwoN?kS|a)tk8Aak1+Q~c1`DpM@?8&i{q&Gp*Lhq Gx9JaXcU@fo literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d3b0c7730137d8bf06845333242267e0b5e74fa GIT binary patch literal 628 zcmY*V!EV$r5S?+dY+80Xzy*E)kwYSt8>p&UD2HAuq_&rpMHFJwMosL<_EJ)|w@Rp| z{sJ8N5kA6KPW^?R>WR7wwe)7jOY(8jY7f?y)LgxMp32av`$p%(TlBo|H;5Z``rR^UBp)WrsTZ*t-+0_=j)ORJE0s@0PC24*M>I zud^K?vOOnTexREa@{e1sPG#Sft~xP9Z^mS3Mv8`ZY-q`T`d}L6hjjtQIEg3B ztWm?*C(F@(vfcH?>h_}OdSb{+8@5K@%Z)rUwUd5rmGa|dZap*)14}b74|@JHgQR4$ P4eM>>)}V$`2|R^6YNn&+ literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/solution.py b/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/solution.py new file mode 100644 index 0000000..25393ca --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/solution.py @@ -0,0 +1,4 @@ +# Code your solution here +dict_a={'1':'Python','2':'Sql','3':'Javascript'} +dict_val=dict_a.update({'4':'Java'}) +print(dict_val) \ No newline at end of file diff --git a/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/test_solution.py b/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/test_solution.py new file mode 100644 index 0000000..02667ae --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_add_item/Solution/test_solution.py @@ -0,0 +1,13 @@ + + +def test_solution(monkeypatch): + ret_val1=None + def g(num1): + nonlocal ret_val1 + ret_val1=num1 + + monkeypatch.setattr('builtins.print',g) + + import solution + + diff --git a/introduction_and_environment/data_types_and_control_flow/2_append/README.md b/introduction_and_environment/data_types_and_control_flow/2_append/README.md new file mode 100644 index 0000000..357f7e5 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_append/README.md @@ -0,0 +1,15 @@ +# Append + +## Motivation +Python collective data type list provides mutable operations like index, slicing, pop, append etc. + +## Problem Description +Write a python script contains a `list_a` list variable holding items hidden from you. +Your goal is to insert a new item at the 3rd position of the list and store the result in another variable `list_b`. +Print the result. + +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/2_append/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/2_append/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd235299a9e46ee3724fda1bfccc8be0a75b18bc GIT binary patch literal 271 zcmXv}!AiqG5Z&FxP{e|tVGj}NQADh^f)^1QFJ-aB?4XOu?6NyWbJZWwV}B`ELGTwm zIg$8=dGiM5%`oTV@vdNeO<(T<*U!HBN5W^e6u4r@1)Rw>%W}%rqAD9O4r> zuMwWtl|up~eT5X9*;Hg5=7q~|T6%P-7cUSh8zJg>No8KNp5;+K^FCjo(MwlvdWVjK WIP`5dI%#-Q4X3JqFlE}8d-50QiA}%& literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/2_append/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/2_append/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d175a3fe50a51c846dbdd013a8698f3fa589390 GIT binary patch literal 1072 zcmY*YPfrs;6rY*hZkPVSC<(zE7ma&pBNZ_*lz_s)3o!vN&Bk@dC}Uz{xk;g0RWFdGp?H-u!;AudnL$%4zHD{a=L8Z&)`U0dEtQ zcnpRjibK@F#ZDrFAdDijQ^JT6YMi5vMe!bT%s+rdyIrg|_{y_oz%G7)q38?xjCz=2 zO3v*ZXXp}9Bf}E{l}w64oRf?kk=)3P3p60PnVI6JG%ihA%1pRt>3EM!Oj?$uOKXA# zmiPeqaz-YYAAx6UFD8)JzA?enzCnJ~$O{C>Z#t_zK-zTfyRnG!60Oi`RthlqmYf4b zC9@{@6FvjoCd!Q*7=p^$e}P)4UJF{F4JHGD1qko{Ko0Jh@i1C(u(COm-bX)N;kvI^ z{Pj!sonTzJTQmw{cbkcUOj0*y$6hyyC5xr|CYC&*!>$aHxUru!-i~BHiQSzO#=C)F z!rk_z-`F3e;IrK50kDRijC&s zc>Z7*gffUlGvxtr(E1#FMcQo#kDHI4q@$K2DyK7NxxK8tr;ccb0laun$(P&H*s3Fx zea(RD8E_0`09KopHml=#UqBmVQDY785L|Prsw|lFrQ}>sP{*29R+Y_kRM7Uhy6*ws z(BmxS-6TqV&QuN3-Zgn;O%Bp$F)>dS7Q>uwhOR8>Db6|!>s@T^m0rlp?WKD;Q# zz`;dVxCxb1{mu_k{9_g&jeoxnU=uI2coRR_3 oP0o&aAVKU+NR?+XUWYqHrGm{ZQxLM(BN)GsZ4_K|$VLy)KgFUgtpET3 literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/2_append/Solution/solution.py b/introduction_and_environment/data_types_and_control_flow/2_append/Solution/solution.py new file mode 100644 index 0000000..8e8cd6d --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_append/Solution/solution.py @@ -0,0 +1,4 @@ +# Code your solution here +list_a=[True,False,False,False,False,True] +list_b=list_a.insert(3,True) +print(list_b) \ No newline at end of file diff --git a/introduction_and_environment/data_types_and_control_flow/2_append/Solution/test_solution.py b/introduction_and_environment/data_types_and_control_flow/2_append/Solution/test_solution.py new file mode 100644 index 0000000..02667ae --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_append/Solution/test_solution.py @@ -0,0 +1,13 @@ + + +def test_solution(monkeypatch): + ret_val1=None + def g(num1): + nonlocal ret_val1 + ret_val1=num1 + + monkeypatch.setattr('builtins.print',g) + + import solution + + diff --git a/introduction_and_environment/data_types_and_control_flow/2_except_letter/README.md b/introduction_and_environment/data_types_and_control_flow/2_except_letter/README.md new file mode 100644 index 0000000..5d8f03c --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_except_letter/README.md @@ -0,0 +1,14 @@ +# Except Letter + +## Motivation +Vowels are 'a' | 'e' | 'i' | 'o' | 'u' . "BYTE ACADEMY"- Let us ignore the vowels from the Brand. + +## Problem Description +Write a Python script that declares a variable `string` which contains value `BYTE ACADEMY`. +Construct a loop to run upto length of `string` and check whether each character is a vowel or not. If not vowel , store the result of characters in another variable `data`. +Print the result. +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3cb6a97748ccbd63bb1c15301a26fa0778d29a28 GIT binary patch literal 315 zcmXv~%}T>S5Z+0)QbHTNc@s}U5AonpN-<3%2vvkuq+wM`cF@ptH{IRP)T2I(_)2^A zEj+m?`oVlZFh4Nkem@`%)6x6Wr_=8?{KI$V(v==M;v^#+GH6bbOvvML=Ap;Em9Ijl z{$2sSBa*=;+=LGVeS{AH!s(0*I&Z!4VxFGFNjyn!7M55@EyTA2Y7ewgg?O=)FU`_I zVLO$}=8LGVySk^JI=Nu?8kJ@-Ul)Q+P_K-vn859GE`>p1*tIZ9@;Wz#6wzEpcRTYc z1xp)Ld7)9W#5F2eMpvcWvhyfya;!`=MPpF0nJnvelIcHlR_$zexON*$9C_^%dX6Yi K2;dL`kHRl-=vPVr literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78630992afbf5264199434acd1e2bcbb3bb226c5 GIT binary patch literal 1076 zcmY*XPfrs;6rY*hwo6+Ym4v{Ji^ffCBZ!z7NyIt-BW_ z5j}hKK#zU{KY*WNuAYqFfRk^w1#y#k^X9$Zy!rj!z9+M@)fXElZ~q{Ke!;r>2zZ;Y z#2qjcQ5>QUE_MYoS{C+&CC=(q;YQ2Qf9)vvW|Dj*rXL%Ixmk= zzbxKCzLJqK=7-=}+KUO~wQr0uwXTp~H1Z4q@~h5j50Dm}`DVs!(5=$0K=Xor7LI=JKlDPRgX}%iDUJ^Sy$Bg@d zV8Yo3AWy>PvoJYwR+>AX15>lrJP;Wz{GVSB z6WphIoi@H8?Y50a_io=!hby+IewaE-?IrEqw?&J3(yQi6 z?MYT#y(kajPLtMWvRT5v@#8HBWex(8vh?}cvcMNG}O!s{|!K{d7t z640|9&J(WY+-|}nPrB?l4ZYaY-LxyJ7A0|?4O370JzfH06LvNI@I=P4x^{TbDGrlT z53e5{6{BF|q9l*?~GKrOnH u2DK(+fOLzqBOXW)dlgcZX^c1EPEn~~bIlZltn~;+Fk~AA7ag+DE%X;iP%qE` literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/solution.py b/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/solution.py new file mode 100644 index 0000000..4e63ff5 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/solution.py @@ -0,0 +1,11 @@ +# Code your solution here +string="BYTE ACADEMY" +data='' +for i in string: + if i!='E' and i!='A': + data=data+i + else: + pass +print(data) + + diff --git a/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/test_solution.py b/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/test_solution.py new file mode 100644 index 0000000..20d9403 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/test_solution.py @@ -0,0 +1,14 @@ +def test_solution(monkeypatch): + x="BYTE ACADEMY" + ret_val1= None + + def g(num1): + nonlocal ret_val1 + ret_val1=num1 + + monkeypatch.setattr('builtins.print',g) + + import solution + assert solution.string==x + + diff --git a/introduction_and_environment/data_types_and_control_flow/2_farm_area/README.md b/introduction_and_environment/data_types_and_control_flow/2_farm_area/README.md new file mode 100644 index 0000000..1838e75 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_farm_area/README.md @@ -0,0 +1,15 @@ +# Farm Area + +## Motivation +A Farmers field has length and breadth in feet. + +## Problem Description +Write a Python script that asks the user to enter the field values of length and bredth in objects `length` and `bredth`. +Your goal is to compute the area of the farmers field and store the result in variable `data`. +Print the result. + +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1bdf5a87d910dc2694d7e8166e072c72389b0ce GIT binary patch literal 293 zcmX|6%Sr=55S-aZvMl80HwZb5ha4rSF&gk9Li7>_W!-7aklmhjW|o+%`vHDOerc}$ zg(rK1v7xJ~p}LE{9*uHFHNE_N{v!VFhhs$~uBhFF02uI&b$k{5s~94PH;Fy%`Gl=BnEt zKKtrdAmn#aXcXlK*u|STFv1`rZ7?$(T9g18+U*h$Mw#`Tv>gVIiDzG+E!pYfS*F!+ zEMvE@iw2&^fYClZMW0hV^At|V3GGp4v(j^S3@6Y7=CCr#G$ZGPxfx6;5F=MIs%2JX zB!aP(Sx@NLW-u;gc2?S_V<&UO&(b=#SuJz$oVs4`(W%YmWa-?Ql6^;fi~Hrwngah0 zC09!^#eFT?Q!sOB3as(Hb%%`0>;}7;l?Q;bD=WBL&D<$`1J95Ln~ZJj4#u~h)DQ_R zA~^%`CE8zNx%E#hXz?0a7&K?VUpKM;FFf_Jo!Jw}SvjME7O>pbJJ)$ZEI$;m{Pb^F z*!(4nX#I<}p1>3k`ES}<%gE$Bd&MwUVXv|~S;a6{oiSG}GB@m6}Y?1}2vGhuOKQA_W7q7{X4U+z`M ziyQgcswb3t$$@7n3(fSftcTU(Mj-GWq;X$IQ(Rof2=BZk!Y*>m{uTmV-hPP-3uN#Y zq!mwa{q^xIegh}2OGpP^xrSyfN3-V5sj>)VASLGwZRzAGs_KLE$lPDR)h!<{F7kPp z@@_Ir10Je6Zu^(4qLaB=br#Fbq}27eO!7C#c4jAq7iloAZRL zdB2zNVIckRFpYvZ(8bj*&v;O_&d#f;+AxXt!=p5i-928_iRr7)G1oMhoa!Z2P*#e{ zd%2RwS}Q8=w~bG}vszTv^CGmk{*)V5xvtW@_~x#aw=N;Ei30%_Y_Ms=soQm^Qx_ck zWV+aQNS!oDeWp9)vn$;t4oQv1^*_feEBBIHzJLpA!Ow4_m1l_zwRm{I2NIdRT2kfN g8o!G^=A`_s=x14YHSYZ(KK&@%G??{sb;)h=CtL01d;kCd literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/solution.py b/introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/solution.py new file mode 100644 index 0000000..c86b9f8 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/solution.py @@ -0,0 +1,8 @@ +# Code your solution here +length=int(input()) +breadth=int(input()) +if length>breadth: + data=length*breadth +else: + pass +print(data) \ No newline at end of file diff --git a/introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/test_solution.py b/introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/test_solution.py new file mode 100644 index 0000000..55b4bd7 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_farm_area/Solution/test_solution.py @@ -0,0 +1,24 @@ +def test_solution(monkeypatch): + x=[6,4] + index=-1 + ret_val1= None + + def f(): + nonlocal index + nonlocal x + index+=1 + return x[index] + + def g(num1): + nonlocal ret_val1 + ret_val1=num1 + + monkeypatch.setattr('builtins.input',f) + monkeypatch.setattr('builtins.print',g) + + import solution + assert solution.length==6 + assert solution.breadth==4 + + + diff --git a/introduction_and_environment/data_types_and_control_flow/2_remove_item/README.md b/introduction_and_environment/data_types_and_control_flow/2_remove_item/README.md new file mode 100644 index 0000000..9bd09c4 --- /dev/null +++ b/introduction_and_environment/data_types_and_control_flow/2_remove_item/README.md @@ -0,0 +1,12 @@ +# Remove-Item + +## Problem Description +Write a python script that contains a `list_1` list variable holding items hidden from you. +Your goal is to remove an item from the list and store the result in another variable `lister`. +Print the result. + +## Testing +* done + +## Submission +* Submit your answers in the *solution.py* file within the *Solutions* subdirectory within this directory diff --git a/introduction_and_environment/data_types_and_control_flow/2_remove_item/Solution/__pycache__/solution.cpython-37.pyc b/introduction_and_environment/data_types_and_control_flow/2_remove_item/Solution/__pycache__/solution.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f405d42505b894bcbefc4a89ecaf750df342186 GIT binary patch literal 284 zcmXwz&q@O^5XO`2pGu)Vg_j;8*rSN}X9ar^q4i)0EoC!ka5q_!sk&Ev5k2}!d-c?V zFW|}9QU~TY-v{#zb1@nX8P(6^ZLy&F-JAc)NSsl}1A<|O8(|WYK4gjk`{0IsawQ-E z@yb+N*goVN|h ki7cR!Q-oU2e6{W)I_|__({_6&HJz&9w0}6Jgnd5be`MQGBLDyZ literal 0 HcmV?d00001 diff --git a/introduction_and_environment/data_types_and_control_flow/2_remove_item/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc b/introduction_and_environment/data_types_and_control_flow/2_remove_item/Solution/__pycache__/test_solution.cpython-37-pytest-5.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1399bd12c6cfa347da881c8fd0de4ebcf8cfa020 GIT binary patch literal 1073 zcmY*XJ#Q015Z&E7pD+Fhf=E&5(txq;B}H8F50Gg2728tL@B>mYdv-#y($3D#yq$Y*ZeG;um7lHCH-8aAzhPf50^TNU z@em9}6o;sTi<3kKK^R45r-TtD)Hp*Oi{gFcn129^_PSUfu*$P-z$t!#q3AREgnF1_ zO3v&YXXpY^Bf}E{l}w64oRf?kk=)3Pb2K2inVI5;G%ie9%1n4?>3EM!Oj?$u3u}S~ zmUs*Kaz-YYAAx6UFD8)JzA?enzD9o0$a4h9uR5zeK-zTfo3V)U60Oi`RthlqmYf4b zC9@{@BR&P)Cd!Q*7=p^$e}P)4-V0iw4JHGD1qknbM-J|o@i1C(u(COm-g`e>;kvJv z;^lMqwP0MhTQmw{cbkcUOj0*y$6hyyC5xrI8%v(hVOIu8+&D-YuST+;#O}@sIUIJ