diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 87edd3b7..23b1cf22 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -4,5 +4,4 @@ FROM gitpod/workspace-full:latest USER gitpod -RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i learnpack@0.0.96 -g && learnpack plugins:install learnpack-python@0.0.34 +RUN pip3 install pytest==4.4.2 pytest-testdox mock && npm i breathecode-cli@1.2.70 -g diff --git a/.gitpod.yml b/.gitpod.yml index e75ca9cd..ab65c986 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -6,7 +6,7 @@ ports: onOpen: open-preview tasks: - command: > - learnpack start; + bc run; github: prebuilds: # enable for the master/default branch (defaults to true) diff --git a/exercises/02-hello-world/app.py b/.learn/resets/02-hello-world/app.py similarity index 100% rename from exercises/02-hello-world/app.py rename to .learn/resets/02-hello-world/app.py diff --git a/bc.json b/bc.json new file mode 100644 index 00000000..141687e6 --- /dev/null +++ b/bc.json @@ -0,0 +1,480 @@ +{ + "port": 3000, + "address": "https://f12ccd6b-9b79-49f2-88ee-bfbeff35b985.ws-us03.gitpod.io", + "editor": "gitpod", + "configPath": { + "config": "bc.json", + "base": ".learn", + "exercises": "./exercises", + "output": ".learn/dist" + }, + "outputPath": "./.learn/dist", + "publicPath": "/preview", + "grading": "isolated", + "ignoreRegex": null, + "webpack_template": null, + "disable_grading": false, + "onCompilerSuccess": null, + "language": "python3", + "compiler": "python3", + "tester": "pytest", + "actions": [ + "run", + "test", + "reset" + ], + "title": "Master Python by practice (interactive)", + "repository": "https://github.com/4GeeksAcademy/master-python-programming-exercises", + "preview": "https://github.com/4GeeksAcademy/master-python-programming-exercises/blob/master/preview.gif?raw=true", + "description": "Practice your Python programming skills with this interactive and auto-graded set of exercises.", + "duration": 10, + "difficulty": "easy", + "video-solutions": false, + "graded": true, + "session": 8309827614104636000, + "exercises": [ + { + "slug": "001-welcome", + "title": "001-welcome", + "done": false, + "path": "exercises/001-welcome", + "translations": [ + "es", + "us" + ], + "graded": false + }, + { + "slug": "002-hello-world", + "title": "002-hello-world", + "done": false, + "path": "exercises/002-hello-world", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "003-sum_of_three_numbers", + "title": "003-sum_of_three_numbers", + "done": false, + "path": "exercises/003-sum_of_three_numbers", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "004-area_of_right_triangle", + "title": "004-area_of_right_triangle", + "done": false, + "path": "exercises/004-area_of_right_triangle", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "005-hello_harry", + "title": "005-hello_harry", + "done": false, + "path": "exercises/005-hello_harry", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "006-previous_and_next", + "title": "006-previous_and_next", + "done": false, + "path": "exercises/006-previous_and_next", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "007-Apple_sharing", + "title": "007-Apple_sharing", + "done": false, + "path": "exercises/007-Apple_sharing", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "007.1-square-value", + "title": "007.1-square-value", + "done": false, + "path": "exercises/007.1-square-value", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "008-hours_and_minutes", + "title": "008-hours_and_minutes", + "done": false, + "path": "exercises/008-hours_and_minutes", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "009-Two_timestamps", + "title": "009-Two_timestamps", + "done": false, + "path": "exercises/009-Two_timestamps", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "010-Two_digits", + "title": "010-Two_digits", + "done": false, + "path": "exercises/010-Two_digits", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "011-Swap_digits", + "title": "011-Swap_digits", + "done": false, + "path": "exercises/011-Swap_digits", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "012-Last_two_digits", + "title": "012-Last_two_digits", + "done": false, + "path": "exercises/012-Last_two_digits", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "013-ten_digits", + "title": "013-ten_digits", + "done": false, + "path": "exercises/013-ten_digits", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "014-sum_of_digits", + "title": "014-sum_of_digits", + "done": false, + "path": "exercises/014-sum_of_digits", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "015-Digit_after_decimal_point", + "title": "015-Digit_after_decimal_point", + "done": false, + "path": "exercises/015-Digit_after_decimal_point", + "translations": [ + "us", + "us" + ], + "graded": true + }, + { + "slug": "016-Car_route", + "title": "016-Car_route", + "done": false, + "path": "exercises/016-Car_route", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "017-Century", + "title": "017-Century", + "done": false, + "path": "exercises/017-Century", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "018-Total_cost", + "title": "018-Total_cost", + "done": false, + "path": "exercises/018-Total_cost", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "019-Day_of_week", + "title": "019-Day_of_week", + "done": false, + "path": "exercises/019-Day_of_week", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "020-Digital_clock", + "title": "020-Digital_clock", + "done": false, + "path": "exercises/020-Digital_clock", + "translations": [ + "es", + "us" + ], + "graded": true + }, + { + "slug": "021-factorial", + "title": "021-factorial", + "done": false, + "path": "exercises/021-factorial", + "translations": [ + "es", + "us" + ], + "graded": false + }, + { + "slug": "022-Integral", + "title": "022-Integral", + "done": false, + "path": "exercises/022-Integral", + "translations": [ + "es", + "us" + ], + "graded": false + }, + { + "slug": "023-list-and-tuple", + "title": "023-list-and-tuple", + "done": false, + "path": "exercises/023-list-and-tuple", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "24-class-with-two-methods", + "title": "24-class-with-two-methods", + "done": false, + "path": "exercises/24-class-with-two-methods", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "25-print-formula", + "title": "25-print-formula", + "done": false, + "path": "exercises/25-print-formula", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "26-two-dimensional-array", + "title": "26-two-dimensional-array", + "done": false, + "path": "exercises/26-two-dimensional-array", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "27-sequence-of-words", + "title": "27-sequence-of-words", + "done": false, + "path": "exercises/27-sequence-of-words", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "28-sequence-of-lines", + "title": "28-sequence-of-lines", + "done": false, + "path": "exercises/28-sequence-of-lines", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "29-remove-duplicate-words", + "title": "29-remove-duplicate-words", + "done": false, + "path": "exercises/29-remove-duplicate-words", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "30-divisable-binary", + "title": "30-divisable-binary", + "done": false, + "path": "exercises/30-divisable-binary", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "31-sum-eigth-digit", + "title": "31-sum-eigth-digit", + "done": false, + "path": "exercises/31-sum-eigth-digit", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "32-numbers-of-letters-and-digits", + "title": "32-numbers-of-letters-and-digits", + "done": false, + "path": "exercises/32-numbers-of-letters-and-digits", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "33-number-of-uppercase", + "title": "33-number-of-uppercase", + "done": false, + "path": "exercises/33-number-of-uppercase", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "34-a_aa_aaa_aaaa", + "title": "34-a_aa_aaa_aaaa", + "done": false, + "path": "exercises/34-a_aa_aaa_aaaa", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "35-square-each-odd-number", + "title": "35-square-each-odd-number", + "done": false, + "path": "exercises/35-square-each-odd-number", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "36-net-amount", + "title": "36-net-amount", + "done": false, + "path": "exercises/36-net-amount", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "37-validity-of-password", + "title": "37-validity-of-password", + "done": false, + "path": "exercises/37-validity-of-password", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "38-sort-tuples-ascending", + "title": "38-sort-tuples-ascending", + "done": false, + "path": "exercises/38-sort-tuples-ascending", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "39-class-that-iterates", + "title": "39-class-that-iterates", + "done": false, + "path": "exercises/39-class-that-iterates", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "40-compute-robot-distance", + "title": "40-compute-robot-distance", + "done": false, + "path": "exercises/40-compute-robot-distance", + "translations": [ + "us" + ], + "graded": false + }, + { + "slug": "41-frequency-of-words", + "title": "41-frequency-of-words", + "done": false, + "path": "exercises/41-frequency-of-words", + "translations": [ + "us" + ], + "graded": false + } + ] +} \ No newline at end of file diff --git a/exercises/001-welcome/README.es.md b/exercises/001-welcome/README.es.md new file mode 100644 index 00000000..45105383 --- /dev/null +++ b/exercises/001-welcome/README.es.md @@ -0,0 +1,4 @@ +# Bienvenid@ a Python! + +¡¡Nos estusiasma mucho tenerte aquí!! 🎉 😂 +Presiona `Next` `Next →` en la esquina superior la derecha cuando quieras empezar. diff --git a/exercises/01-welcome/README.md b/exercises/001-welcome/README.md similarity index 100% rename from exercises/01-welcome/README.md rename to exercises/001-welcome/README.md diff --git a/exercises/02-hello-world/README.es.md b/exercises/002-hello-world/README.es.md similarity index 100% rename from exercises/02-hello-world/README.es.md rename to exercises/002-hello-world/README.es.md diff --git a/exercises/02-hello-world/README.md b/exercises/002-hello-world/README.md similarity index 100% rename from exercises/02-hello-world/README.md rename to exercises/002-hello-world/README.md diff --git a/exercises/002-hello-world/app.py b/exercises/002-hello-world/app.py new file mode 100644 index 00000000..801de24b --- /dev/null +++ b/exercises/002-hello-world/app.py @@ -0,0 +1 @@ +# your code here \ No newline at end of file diff --git a/exercises/02-hello-world/test.py b/exercises/002-hello-world/test.py similarity index 100% rename from exercises/02-hello-world/test.py rename to exercises/002-hello-world/test.py diff --git a/exercises/03-sum_of_three_numbers/README.es.md b/exercises/003-sum_of_three_numbers/README.es.md similarity index 100% rename from exercises/03-sum_of_three_numbers/README.es.md rename to exercises/003-sum_of_three_numbers/README.es.md diff --git a/exercises/03-sum_of_three_numbers/README.md b/exercises/003-sum_of_three_numbers/README.md similarity index 100% rename from exercises/03-sum_of_three_numbers/README.md rename to exercises/003-sum_of_three_numbers/README.md diff --git a/exercises/03-sum_of_three_numbers/app.py b/exercises/003-sum_of_three_numbers/app.py similarity index 100% rename from exercises/03-sum_of_three_numbers/app.py rename to exercises/003-sum_of_three_numbers/app.py diff --git a/exercises/03-sum_of_three_numbers/test.py b/exercises/003-sum_of_three_numbers/test.py similarity index 100% rename from exercises/03-sum_of_three_numbers/test.py rename to exercises/003-sum_of_three_numbers/test.py diff --git a/exercises/04-area_of_right_triangle/README.es.md b/exercises/004-area_of_right_triangle/README.es.md similarity index 100% rename from exercises/04-area_of_right_triangle/README.es.md rename to exercises/004-area_of_right_triangle/README.es.md diff --git a/exercises/04-area_of_right_triangle/README.md b/exercises/004-area_of_right_triangle/README.md similarity index 100% rename from exercises/04-area_of_right_triangle/README.md rename to exercises/004-area_of_right_triangle/README.md diff --git a/exercises/04-area_of_right_triangle/app.py b/exercises/004-area_of_right_triangle/app.py similarity index 100% rename from exercises/04-area_of_right_triangle/app.py rename to exercises/004-area_of_right_triangle/app.py diff --git a/exercises/04-area_of_right_triangle/test.py b/exercises/004-area_of_right_triangle/test.py similarity index 100% rename from exercises/04-area_of_right_triangle/test.py rename to exercises/004-area_of_right_triangle/test.py diff --git a/exercises/05-hello_harry/README.es.md b/exercises/005-hello_harry/README.es.md similarity index 100% rename from exercises/05-hello_harry/README.es.md rename to exercises/005-hello_harry/README.es.md diff --git a/exercises/05-hello_harry/README.md b/exercises/005-hello_harry/README.md similarity index 100% rename from exercises/05-hello_harry/README.md rename to exercises/005-hello_harry/README.md diff --git a/exercises/05-hello_harry/app.py b/exercises/005-hello_harry/app.py similarity index 100% rename from exercises/05-hello_harry/app.py rename to exercises/005-hello_harry/app.py diff --git a/exercises/05-hello_harry/test.py b/exercises/005-hello_harry/test.py similarity index 100% rename from exercises/05-hello_harry/test.py rename to exercises/005-hello_harry/test.py diff --git a/exercises/06-previous_and_next/README.es.md b/exercises/006-previous_and_next/README.es.md similarity index 100% rename from exercises/06-previous_and_next/README.es.md rename to exercises/006-previous_and_next/README.es.md diff --git a/exercises/06-previous_and_next/README.md b/exercises/006-previous_and_next/README.md similarity index 100% rename from exercises/06-previous_and_next/README.md rename to exercises/006-previous_and_next/README.md diff --git a/exercises/06-previous_and_next/app.py b/exercises/006-previous_and_next/app.py similarity index 100% rename from exercises/06-previous_and_next/app.py rename to exercises/006-previous_and_next/app.py diff --git a/exercises/06-previous_and_next/test.py b/exercises/006-previous_and_next/test.py similarity index 100% rename from exercises/06-previous_and_next/test.py rename to exercises/006-previous_and_next/test.py diff --git a/exercises/07-Apple_sharing/README.es.md b/exercises/007-Apple_sharing/README.es.md similarity index 100% rename from exercises/07-Apple_sharing/README.es.md rename to exercises/007-Apple_sharing/README.es.md diff --git a/exercises/07-Apple_sharing/README.md b/exercises/007-Apple_sharing/README.md similarity index 100% rename from exercises/07-Apple_sharing/README.md rename to exercises/007-Apple_sharing/README.md diff --git a/exercises/07-Apple_sharing/app.py b/exercises/007-Apple_sharing/app.py similarity index 100% rename from exercises/07-Apple_sharing/app.py rename to exercises/007-Apple_sharing/app.py diff --git a/exercises/07-Apple_sharing/test.py b/exercises/007-Apple_sharing/test.py similarity index 100% rename from exercises/07-Apple_sharing/test.py rename to exercises/007-Apple_sharing/test.py diff --git a/exercises/07.1-square-value/README.es.md b/exercises/007.1-square-value/README.es.md similarity index 100% rename from exercises/07.1-square-value/README.es.md rename to exercises/007.1-square-value/README.es.md diff --git a/exercises/07.1-square-value/README.md b/exercises/007.1-square-value/README.md similarity index 100% rename from exercises/07.1-square-value/README.md rename to exercises/007.1-square-value/README.md diff --git a/exercises/07.1-square-value/app.py b/exercises/007.1-square-value/app.py similarity index 100% rename from exercises/07.1-square-value/app.py rename to exercises/007.1-square-value/app.py diff --git a/exercises/07.1-square-value/solution.py b/exercises/007.1-square-value/solution.py similarity index 100% rename from exercises/07.1-square-value/solution.py rename to exercises/007.1-square-value/solution.py diff --git a/exercises/07.1-square-value/test.py b/exercises/007.1-square-value/test.py similarity index 100% rename from exercises/07.1-square-value/test.py rename to exercises/007.1-square-value/test.py diff --git a/exercises/08-hours_and_minutes/README.es.md b/exercises/008-hours_and_minutes/README.es.md similarity index 100% rename from exercises/08-hours_and_minutes/README.es.md rename to exercises/008-hours_and_minutes/README.es.md diff --git a/exercises/08-hours_and_minutes/README.md b/exercises/008-hours_and_minutes/README.md similarity index 100% rename from exercises/08-hours_and_minutes/README.md rename to exercises/008-hours_and_minutes/README.md diff --git a/exercises/08-hours_and_minutes/app.py b/exercises/008-hours_and_minutes/app.py similarity index 100% rename from exercises/08-hours_and_minutes/app.py rename to exercises/008-hours_and_minutes/app.py diff --git a/exercises/08-hours_and_minutes/test.py b/exercises/008-hours_and_minutes/test.py similarity index 100% rename from exercises/08-hours_and_minutes/test.py rename to exercises/008-hours_and_minutes/test.py diff --git a/exercises/09-Two_timestamps/README.es.md b/exercises/009-Two_timestamps/README.es.md similarity index 100% rename from exercises/09-Two_timestamps/README.es.md rename to exercises/009-Two_timestamps/README.es.md diff --git a/exercises/09-Two_timestamps/README.md b/exercises/009-Two_timestamps/README.md similarity index 100% rename from exercises/09-Two_timestamps/README.md rename to exercises/009-Two_timestamps/README.md diff --git a/exercises/09-Two_timestamps/app.py b/exercises/009-Two_timestamps/app.py similarity index 100% rename from exercises/09-Two_timestamps/app.py rename to exercises/009-Two_timestamps/app.py diff --git a/exercises/09-Two_timestamps/test.py b/exercises/009-Two_timestamps/test.py similarity index 100% rename from exercises/09-Two_timestamps/test.py rename to exercises/009-Two_timestamps/test.py diff --git a/exercises/01-welcome/README.es.md b/exercises/01-welcome/README.es.md deleted file mode 100644 index 9635c1a9..00000000 --- a/exercises/01-welcome/README.es.md +++ /dev/null @@ -1,4 +0,0 @@ -# Bienvenid@ a Python! - -¡¡Nos estusiasma mucho tenerte aquí!! 🎉 😂 -Presiona `Next` `Next →` de arriba a la derecha cuando quieras empezar. diff --git a/exercises/10-Two_digits/README.es.md b/exercises/010-Two_digits/README.es.md similarity index 100% rename from exercises/10-Two_digits/README.es.md rename to exercises/010-Two_digits/README.es.md diff --git a/exercises/10-Two_digits/README.md b/exercises/010-Two_digits/README.md similarity index 100% rename from exercises/10-Two_digits/README.md rename to exercises/010-Two_digits/README.md diff --git a/exercises/10-Two_digits/app.py b/exercises/010-Two_digits/app.py similarity index 100% rename from exercises/10-Two_digits/app.py rename to exercises/010-Two_digits/app.py diff --git a/exercises/10-Two_digits/test.py b/exercises/010-Two_digits/test.py similarity index 100% rename from exercises/10-Two_digits/test.py rename to exercises/010-Two_digits/test.py diff --git a/exercises/11-Swap_digits/README.es.md b/exercises/011-Swap_digits/README.es.md similarity index 78% rename from exercises/11-Swap_digits/README.es.md rename to exercises/011-Swap_digits/README.es.md index 49078fd8..e28c922e 100644 --- a/exercises/11-Swap_digits/README.es.md +++ b/exercises/011-Swap_digits/README.es.md @@ -11,7 +11,8 @@ Dado un entero de dos dígitos, intercambia sus dígitos de posición e imprime * 97 **Teoría** -Si no sabes cómo empezar la solución a esta asignación, por favor, revisa la teoría en esta lección: + +Si no sabes cómo empezar la solución a este ejercicio revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ También puedes intentar paso a paso con trozos de la teoría: diff --git a/exercises/11-Swap_digits/README.md b/exercises/011-Swap_digits/README.md similarity index 100% rename from exercises/11-Swap_digits/README.md rename to exercises/011-Swap_digits/README.md diff --git a/exercises/11-Swap_digits/app.py b/exercises/011-Swap_digits/app.py similarity index 100% rename from exercises/11-Swap_digits/app.py rename to exercises/011-Swap_digits/app.py diff --git a/exercises/11-Swap_digits/test.py b/exercises/011-Swap_digits/test.py similarity index 100% rename from exercises/11-Swap_digits/test.py rename to exercises/011-Swap_digits/test.py diff --git a/exercises/12-Last_two_digits/README.es.md b/exercises/012-Last_two_digits/README.es.md similarity index 100% rename from exercises/12-Last_two_digits/README.es.md rename to exercises/012-Last_two_digits/README.es.md diff --git a/exercises/12-Last_two_digits/README.md b/exercises/012-Last_two_digits/README.md similarity index 100% rename from exercises/12-Last_two_digits/README.md rename to exercises/012-Last_two_digits/README.md diff --git a/exercises/12-Last_two_digits/app.py b/exercises/012-Last_two_digits/app.py similarity index 100% rename from exercises/12-Last_two_digits/app.py rename to exercises/012-Last_two_digits/app.py diff --git a/exercises/12-Last_two_digits/test.py b/exercises/012-Last_two_digits/test.py similarity index 100% rename from exercises/12-Last_two_digits/test.py rename to exercises/012-Last_two_digits/test.py diff --git a/exercises/13-Tens_digit/README.es.md b/exercises/013-ten_digits/README.es.md similarity index 100% rename from exercises/13-Tens_digit/README.es.md rename to exercises/013-ten_digits/README.es.md diff --git a/exercises/13-Tens_digit/README.md b/exercises/013-ten_digits/README.md similarity index 100% rename from exercises/13-Tens_digit/README.md rename to exercises/013-ten_digits/README.md diff --git a/exercises/13-Tens_digit/app.py b/exercises/013-ten_digits/app.py similarity index 100% rename from exercises/13-Tens_digit/app.py rename to exercises/013-ten_digits/app.py diff --git a/exercises/13-Tens_digit/test.py b/exercises/013-ten_digits/test.py similarity index 100% rename from exercises/13-Tens_digit/test.py rename to exercises/013-ten_digits/test.py diff --git a/exercises/14-sum_of_digits/README.es.md b/exercises/014-sum_of_digits/README.es.md similarity index 100% rename from exercises/14-sum_of_digits/README.es.md rename to exercises/014-sum_of_digits/README.es.md diff --git a/exercises/14-sum_of_digits/README.md b/exercises/014-sum_of_digits/README.md similarity index 100% rename from exercises/14-sum_of_digits/README.md rename to exercises/014-sum_of_digits/README.md diff --git a/exercises/14-sum_of_digits/app.py b/exercises/014-sum_of_digits/app.py similarity index 100% rename from exercises/14-sum_of_digits/app.py rename to exercises/014-sum_of_digits/app.py diff --git a/exercises/14-sum_of_digits/test.py b/exercises/014-sum_of_digits/test.py similarity index 100% rename from exercises/14-sum_of_digits/test.py rename to exercises/014-sum_of_digits/test.py diff --git a/exercises/15-Digit_after_decimal_point/README,es.md b/exercises/015-Digit_after_decimal_point/README.es.md similarity index 100% rename from exercises/15-Digit_after_decimal_point/README,es.md rename to exercises/015-Digit_after_decimal_point/README.es.md diff --git a/exercises/15-Digit_after_decimal_point/README.md b/exercises/015-Digit_after_decimal_point/README.md similarity index 100% rename from exercises/15-Digit_after_decimal_point/README.md rename to exercises/015-Digit_after_decimal_point/README.md diff --git a/exercises/15-Digit_after_decimal_point/app.py b/exercises/015-Digit_after_decimal_point/app.py similarity index 100% rename from exercises/15-Digit_after_decimal_point/app.py rename to exercises/015-Digit_after_decimal_point/app.py diff --git a/exercises/15-Digit_after_decimal_point/test.py b/exercises/015-Digit_after_decimal_point/test.py similarity index 100% rename from exercises/15-Digit_after_decimal_point/test.py rename to exercises/015-Digit_after_decimal_point/test.py diff --git a/exercises/16-Car_route/README.es.md b/exercises/016-Car_route/README.es.md similarity index 100% rename from exercises/16-Car_route/README.es.md rename to exercises/016-Car_route/README.es.md diff --git a/exercises/16-Car_route/README.md b/exercises/016-Car_route/README.md similarity index 100% rename from exercises/16-Car_route/README.md rename to exercises/016-Car_route/README.md diff --git a/exercises/16-Car_route/app.py b/exercises/016-Car_route/app.py similarity index 100% rename from exercises/16-Car_route/app.py rename to exercises/016-Car_route/app.py diff --git a/exercises/16-Car_route/test.py b/exercises/016-Car_route/test.py similarity index 100% rename from exercises/16-Car_route/test.py rename to exercises/016-Car_route/test.py diff --git a/exercises/17-Century/README.es.md b/exercises/017-Century/README.es.md similarity index 100% rename from exercises/17-Century/README.es.md rename to exercises/017-Century/README.es.md diff --git a/exercises/17-Century/README.md b/exercises/017-Century/README.md similarity index 100% rename from exercises/17-Century/README.md rename to exercises/017-Century/README.md diff --git a/exercises/17-Century/app.py b/exercises/017-Century/app.py similarity index 100% rename from exercises/17-Century/app.py rename to exercises/017-Century/app.py diff --git a/exercises/17-Century/test.py b/exercises/017-Century/test.py similarity index 100% rename from exercises/17-Century/test.py rename to exercises/017-Century/test.py diff --git a/exercises/18-Total_cost/README.es.md b/exercises/018-Total_cost/README.es.md similarity index 100% rename from exercises/18-Total_cost/README.es.md rename to exercises/018-Total_cost/README.es.md diff --git a/exercises/18-Total_cost/README.md b/exercises/018-Total_cost/README.md similarity index 100% rename from exercises/18-Total_cost/README.md rename to exercises/018-Total_cost/README.md diff --git a/exercises/18-Total_cost/app.py b/exercises/018-Total_cost/app.py similarity index 100% rename from exercises/18-Total_cost/app.py rename to exercises/018-Total_cost/app.py diff --git a/exercises/18-Total_cost/test.py b/exercises/018-Total_cost/test.py similarity index 100% rename from exercises/18-Total_cost/test.py rename to exercises/018-Total_cost/test.py diff --git a/exercises/19-Day_of_week/README.es.md b/exercises/019-Day_of_week/README.es.md similarity index 100% rename from exercises/19-Day_of_week/README.es.md rename to exercises/019-Day_of_week/README.es.md diff --git a/exercises/19-Day_of_week/README.md b/exercises/019-Day_of_week/README.md similarity index 100% rename from exercises/19-Day_of_week/README.md rename to exercises/019-Day_of_week/README.md diff --git a/exercises/19-Day_of_week/app.py b/exercises/019-Day_of_week/app.py similarity index 100% rename from exercises/19-Day_of_week/app.py rename to exercises/019-Day_of_week/app.py diff --git a/exercises/19-Day_of_week/test.py b/exercises/019-Day_of_week/test.py similarity index 100% rename from exercises/19-Day_of_week/test.py rename to exercises/019-Day_of_week/test.py diff --git a/exercises/20-Digital_clock/README.es.md b/exercises/020-Digital_clock/README.es.md similarity index 100% rename from exercises/20-Digital_clock/README.es.md rename to exercises/020-Digital_clock/README.es.md diff --git a/exercises/20-Digital_clock/README.md b/exercises/020-Digital_clock/README.md similarity index 100% rename from exercises/20-Digital_clock/README.md rename to exercises/020-Digital_clock/README.md diff --git a/exercises/20-Digital_clock/app.py b/exercises/020-Digital_clock/app.py similarity index 100% rename from exercises/20-Digital_clock/app.py rename to exercises/020-Digital_clock/app.py diff --git a/exercises/20-Digital_clock/test.py b/exercises/020-Digital_clock/test.py similarity index 100% rename from exercises/20-Digital_clock/test.py rename to exercises/020-Digital_clock/test.py diff --git a/exercises/21-factorial/README.es.md b/exercises/021-factorial/README.es.md similarity index 100% rename from exercises/21-factorial/README.es.md rename to exercises/021-factorial/README.es.md diff --git a/exercises/21-factorial/README.md b/exercises/021-factorial/README.md similarity index 100% rename from exercises/21-factorial/README.md rename to exercises/021-factorial/README.md diff --git a/exercises/21-factorial/app.py b/exercises/021-factorial/app.py similarity index 100% rename from exercises/21-factorial/app.py rename to exercises/021-factorial/app.py diff --git a/exercises/21-factorial/solution.hide.py b/exercises/021-factorial/solution.hide.py similarity index 100% rename from exercises/21-factorial/solution.hide.py rename to exercises/021-factorial/solution.hide.py diff --git a/exercises/22-Integral/README.es.md b/exercises/022-Integral/README.es.md similarity index 100% rename from exercises/22-Integral/README.es.md rename to exercises/022-Integral/README.es.md diff --git a/exercises/22-Integral/README.md b/exercises/022-Integral/README.md similarity index 100% rename from exercises/22-Integral/README.md rename to exercises/022-Integral/README.md diff --git a/exercises/22-Integral/app.py b/exercises/022-Integral/app.py similarity index 100% rename from exercises/22-Integral/app.py rename to exercises/022-Integral/app.py diff --git a/exercises/22-Integral/solution.hide.py b/exercises/022-Integral/solution.hide.py similarity index 100% rename from exercises/22-Integral/solution.hide.py rename to exercises/022-Integral/solution.hide.py diff --git a/exercises/23-list-and-tuple/README.es.md b/exercises/023-list-and-tuple/README.es.md similarity index 100% rename from exercises/23-list-and-tuple/README.es.md rename to exercises/023-list-and-tuple/README.es.md diff --git a/exercises/23-list-and-tuple/README.md b/exercises/023-list-and-tuple/README.md similarity index 100% rename from exercises/23-list-and-tuple/README.md rename to exercises/023-list-and-tuple/README.md diff --git a/exercises/23-list-and-tuple/app.py b/exercises/023-list-and-tuple/app.py similarity index 100% rename from exercises/23-list-and-tuple/app.py rename to exercises/023-list-and-tuple/app.py diff --git a/exercises/23-list-and-tuple/solution.hide.py b/exercises/023-list-and-tuple/solution.hide.py similarity index 100% rename from exercises/23-list-and-tuple/solution.hide.py rename to exercises/023-list-and-tuple/solution.hide.py diff --git a/exercises/24-class-with-two-methods/README.es.md b/exercises/024-class-with-two-methods/README.es.md similarity index 100% rename from exercises/24-class-with-two-methods/README.es.md rename to exercises/024-class-with-two-methods/README.es.md diff --git a/exercises/24-class-with-two-methods/README.md b/exercises/024-class-with-two-methods/README.md similarity index 100% rename from exercises/24-class-with-two-methods/README.md rename to exercises/024-class-with-two-methods/README.md diff --git a/exercises/24-class-with-two-methods/app.py b/exercises/024-class-with-two-methods/app.py similarity index 100% rename from exercises/24-class-with-two-methods/app.py rename to exercises/024-class-with-two-methods/app.py diff --git a/exercises/24-class-with-two-methods/solution.hide.py b/exercises/024-class-with-two-methods/solution.hide.py similarity index 100% rename from exercises/24-class-with-two-methods/solution.hide.py rename to exercises/024-class-with-two-methods/solution.hide.py diff --git a/exercises/25-print-formula/README.es.md b/exercises/025-print-formula/README.es.md similarity index 100% rename from exercises/25-print-formula/README.es.md rename to exercises/025-print-formula/README.es.md diff --git a/exercises/25-print-formula/README.md b/exercises/025-print-formula/README.md similarity index 100% rename from exercises/25-print-formula/README.md rename to exercises/025-print-formula/README.md diff --git a/exercises/25-print-formula/app.py b/exercises/025-print-formula/app.py similarity index 100% rename from exercises/25-print-formula/app.py rename to exercises/025-print-formula/app.py diff --git a/exercises/25-print-formula/solution.hide.py b/exercises/025-print-formula/solution.hide.py similarity index 100% rename from exercises/25-print-formula/solution.hide.py rename to exercises/025-print-formula/solution.hide.py diff --git a/exercises/26-two-dimensional-array/README.es.md b/exercises/026-two-dimensional-array/README.es.md similarity index 100% rename from exercises/26-two-dimensional-array/README.es.md rename to exercises/026-two-dimensional-array/README.es.md diff --git a/exercises/26-two-dimensional-array/README.md b/exercises/026-two-dimensional-array/README.md similarity index 100% rename from exercises/26-two-dimensional-array/README.md rename to exercises/026-two-dimensional-array/README.md diff --git a/exercises/26-two-dimensional-array/app.py b/exercises/026-two-dimensional-array/app.py similarity index 100% rename from exercises/26-two-dimensional-array/app.py rename to exercises/026-two-dimensional-array/app.py diff --git a/exercises/26-two-dimensional-array/solution.hide.py b/exercises/026-two-dimensional-array/solution.hide.py similarity index 100% rename from exercises/26-two-dimensional-array/solution.hide.py rename to exercises/026-two-dimensional-array/solution.hide.py diff --git a/exercises/27-sequence-of-words/README.es.md b/exercises/027-sequence-of-words/README.es.md similarity index 100% rename from exercises/27-sequence-of-words/README.es.md rename to exercises/027-sequence-of-words/README.es.md diff --git a/exercises/27-sequence-of-words/README.md b/exercises/027-sequence-of-words/README.md similarity index 100% rename from exercises/27-sequence-of-words/README.md rename to exercises/027-sequence-of-words/README.md diff --git a/exercises/27-sequence-of-words/app.py b/exercises/027-sequence-of-words/app.py similarity index 100% rename from exercises/27-sequence-of-words/app.py rename to exercises/027-sequence-of-words/app.py diff --git a/exercises/27-sequence-of-words/solution.hide.py b/exercises/027-sequence-of-words/solution.hide.py similarity index 100% rename from exercises/27-sequence-of-words/solution.hide.py rename to exercises/027-sequence-of-words/solution.hide.py diff --git a/exercises/28-sequence-of-lines/README.es.md b/exercises/028-sequence-of-lines/README.es.md similarity index 100% rename from exercises/28-sequence-of-lines/README.es.md rename to exercises/028-sequence-of-lines/README.es.md diff --git a/exercises/28-sequence-of-lines/README.md b/exercises/028-sequence-of-lines/README.md similarity index 100% rename from exercises/28-sequence-of-lines/README.md rename to exercises/028-sequence-of-lines/README.md diff --git a/exercises/28-sequence-of-lines/app.py b/exercises/028-sequence-of-lines/app.py similarity index 100% rename from exercises/28-sequence-of-lines/app.py rename to exercises/028-sequence-of-lines/app.py diff --git a/exercises/28-sequence-of-lines/solution.hide.py b/exercises/028-sequence-of-lines/solution.hide.py similarity index 100% rename from exercises/28-sequence-of-lines/solution.hide.py rename to exercises/028-sequence-of-lines/solution.hide.py diff --git a/exercises/29-remove-duplicate-words/README.es.md b/exercises/029-remove-duplicate-words/README.es.md similarity index 100% rename from exercises/29-remove-duplicate-words/README.es.md rename to exercises/029-remove-duplicate-words/README.es.md diff --git a/exercises/29-remove-duplicate-words/README.md b/exercises/029-remove-duplicate-words/README.md similarity index 100% rename from exercises/29-remove-duplicate-words/README.md rename to exercises/029-remove-duplicate-words/README.md diff --git a/exercises/29-remove-duplicate-words/app.py b/exercises/029-remove-duplicate-words/app.py similarity index 100% rename from exercises/29-remove-duplicate-words/app.py rename to exercises/029-remove-duplicate-words/app.py diff --git a/exercises/29-remove-duplicate-words/solution.hide.py b/exercises/029-remove-duplicate-words/solution.hide.py similarity index 100% rename from exercises/29-remove-duplicate-words/solution.hide.py rename to exercises/029-remove-duplicate-words/solution.hide.py diff --git a/exercises/30-divisable-binary/README.md b/exercises/030-divisable-binary/README.md similarity index 100% rename from exercises/30-divisable-binary/README.md rename to exercises/030-divisable-binary/README.md diff --git a/exercises/30-divisable-binary/app.py b/exercises/030-divisable-binary/app.py similarity index 100% rename from exercises/30-divisable-binary/app.py rename to exercises/030-divisable-binary/app.py diff --git a/exercises/30-divisable-binary/solution.hide.py b/exercises/030-divisable-binary/solution.hide.py similarity index 100% rename from exercises/30-divisable-binary/solution.hide.py rename to exercises/030-divisable-binary/solution.hide.py diff --git a/exercises/31-sum-eigth-digit/README.md b/exercises/031-sum-eigth-digit/README.md similarity index 100% rename from exercises/31-sum-eigth-digit/README.md rename to exercises/031-sum-eigth-digit/README.md diff --git a/exercises/31-sum-eigth-digit/app.py b/exercises/031-sum-eigth-digit/app.py similarity index 100% rename from exercises/31-sum-eigth-digit/app.py rename to exercises/031-sum-eigth-digit/app.py diff --git a/exercises/31-sum-eigth-digit/solution.hide.py b/exercises/031-sum-eigth-digit/solution.hide.py similarity index 100% rename from exercises/31-sum-eigth-digit/solution.hide.py rename to exercises/031-sum-eigth-digit/solution.hide.py diff --git a/exercises/32-numbers-of-letters-and-digits/README.md b/exercises/032-numbers-of-letters-and-digits/README.md similarity index 100% rename from exercises/32-numbers-of-letters-and-digits/README.md rename to exercises/032-numbers-of-letters-and-digits/README.md diff --git a/exercises/32-numbers-of-letters-and-digits/app.py b/exercises/032-numbers-of-letters-and-digits/app.py similarity index 100% rename from exercises/32-numbers-of-letters-and-digits/app.py rename to exercises/032-numbers-of-letters-and-digits/app.py diff --git a/exercises/32-numbers-of-letters-and-digits/solution.hide.py b/exercises/032-numbers-of-letters-and-digits/solution.hide.py similarity index 100% rename from exercises/32-numbers-of-letters-and-digits/solution.hide.py rename to exercises/032-numbers-of-letters-and-digits/solution.hide.py diff --git a/exercises/33-number-of-uppercase/README.md b/exercises/033-number-of-uppercase/README.md similarity index 100% rename from exercises/33-number-of-uppercase/README.md rename to exercises/033-number-of-uppercase/README.md diff --git a/exercises/33-number-of-uppercase/app.py b/exercises/033-number-of-uppercase/app.py similarity index 100% rename from exercises/33-number-of-uppercase/app.py rename to exercises/033-number-of-uppercase/app.py diff --git a/exercises/33-number-of-uppercase/solution.hide.py b/exercises/033-number-of-uppercase/solution.hide.py similarity index 100% rename from exercises/33-number-of-uppercase/solution.hide.py rename to exercises/033-number-of-uppercase/solution.hide.py diff --git a/exercises/34-a_aa_aaa_aaaa/README.md b/exercises/034-a_aa_aaa_aaaa/README.md similarity index 100% rename from exercises/34-a_aa_aaa_aaaa/README.md rename to exercises/034-a_aa_aaa_aaaa/README.md diff --git a/exercises/34-a_aa_aaa_aaaa/app.py b/exercises/034-a_aa_aaa_aaaa/app.py similarity index 100% rename from exercises/34-a_aa_aaa_aaaa/app.py rename to exercises/034-a_aa_aaa_aaaa/app.py diff --git a/exercises/34-a_aa_aaa_aaaa/solution.hide.py b/exercises/034-a_aa_aaa_aaaa/solution.hide.py similarity index 100% rename from exercises/34-a_aa_aaa_aaaa/solution.hide.py rename to exercises/034-a_aa_aaa_aaaa/solution.hide.py diff --git a/exercises/35-square-each-odd-number/README.md b/exercises/035-square-each-odd-number/README.md similarity index 100% rename from exercises/35-square-each-odd-number/README.md rename to exercises/035-square-each-odd-number/README.md diff --git a/exercises/35-square-each-odd-number/app.py b/exercises/035-square-each-odd-number/app.py similarity index 100% rename from exercises/35-square-each-odd-number/app.py rename to exercises/035-square-each-odd-number/app.py diff --git a/exercises/35-square-each-odd-number/solution.hide.py b/exercises/035-square-each-odd-number/solution.hide.py similarity index 100% rename from exercises/35-square-each-odd-number/solution.hide.py rename to exercises/035-square-each-odd-number/solution.hide.py diff --git a/exercises/36-net-amount/README.md b/exercises/036-net-amount/README.md similarity index 100% rename from exercises/36-net-amount/README.md rename to exercises/036-net-amount/README.md diff --git a/exercises/36-net-amount/app.py b/exercises/036-net-amount/app.py similarity index 100% rename from exercises/36-net-amount/app.py rename to exercises/036-net-amount/app.py diff --git a/exercises/36-net-amount/solution.hide.py b/exercises/036-net-amount/solution.hide.py similarity index 100% rename from exercises/36-net-amount/solution.hide.py rename to exercises/036-net-amount/solution.hide.py diff --git a/exercises/37-validity-of-password/README.md b/exercises/037-validity-of-password/README.md similarity index 100% rename from exercises/37-validity-of-password/README.md rename to exercises/037-validity-of-password/README.md diff --git a/exercises/37-validity-of-password/app.py b/exercises/037-validity-of-password/app.py similarity index 100% rename from exercises/37-validity-of-password/app.py rename to exercises/037-validity-of-password/app.py diff --git a/exercises/37-validity-of-password/solution.hide.py b/exercises/037-validity-of-password/solution.hide.py similarity index 100% rename from exercises/37-validity-of-password/solution.hide.py rename to exercises/037-validity-of-password/solution.hide.py diff --git a/exercises/38-sort-tuples-ascending/README.md b/exercises/038-sort-tuples-ascending/README.md similarity index 100% rename from exercises/38-sort-tuples-ascending/README.md rename to exercises/038-sort-tuples-ascending/README.md diff --git a/exercises/38-sort-tuples-ascending/app.py b/exercises/038-sort-tuples-ascending/app.py similarity index 100% rename from exercises/38-sort-tuples-ascending/app.py rename to exercises/038-sort-tuples-ascending/app.py diff --git a/exercises/38-sort-tuples-ascending/solution.hide.py b/exercises/038-sort-tuples-ascending/solution.hide.py similarity index 100% rename from exercises/38-sort-tuples-ascending/solution.hide.py rename to exercises/038-sort-tuples-ascending/solution.hide.py diff --git a/exercises/39-class-that-iterates/README.md b/exercises/039-class-that-iterates/README.md similarity index 100% rename from exercises/39-class-that-iterates/README.md rename to exercises/039-class-that-iterates/README.md diff --git a/exercises/39-class-that-iterates/app.py b/exercises/039-class-that-iterates/app.py similarity index 100% rename from exercises/39-class-that-iterates/app.py rename to exercises/039-class-that-iterates/app.py diff --git a/exercises/39-class-that-iterates/solution.hide.py b/exercises/039-class-that-iterates/solution.hide.py similarity index 100% rename from exercises/39-class-that-iterates/solution.hide.py rename to exercises/039-class-that-iterates/solution.hide.py diff --git a/exercises/40-compute-robot-distance/README.md b/exercises/040-compute-robot-distance/README.md similarity index 100% rename from exercises/40-compute-robot-distance/README.md rename to exercises/040-compute-robot-distance/README.md diff --git a/exercises/40-compute-robot-distance/app.py b/exercises/040-compute-robot-distance/app.py similarity index 100% rename from exercises/40-compute-robot-distance/app.py rename to exercises/040-compute-robot-distance/app.py diff --git a/exercises/40-compute-robot-distance/solution.hide.py b/exercises/040-compute-robot-distance/solution.hide.py similarity index 100% rename from exercises/40-compute-robot-distance/solution.hide.py rename to exercises/040-compute-robot-distance/solution.hide.py diff --git a/exercises/41-frequency-of-words/README.md b/exercises/041-frequency-of-words/README.md similarity index 100% rename from exercises/41-frequency-of-words/README.md rename to exercises/041-frequency-of-words/README.md diff --git a/exercises/41-frequency-of-words/app.py b/exercises/041-frequency-of-words/app.py similarity index 100% rename from exercises/41-frequency-of-words/app.py rename to exercises/041-frequency-of-words/app.py diff --git a/exercises/41-frequency-of-words/solution.hide.py b/exercises/041-frequency-of-words/solution.hide.py similarity index 100% rename from exercises/41-frequency-of-words/solution.hide.py rename to exercises/041-frequency-of-words/solution.hide.py diff --git a/exercises/042-Clock face/README.es.md b/exercises/042-Clock face/README.es.md new file mode 100644 index 00000000..2cfefbd5 --- /dev/null +++ b/exercises/042-Clock face/README.es.md @@ -0,0 +1,20 @@ +# `42` Clock Face + +## 📝 Instrucciones: + +La manecilla de la hora de un reloj analógico giró x grados desde la medianoche. Determina el ángulo con el que giró el minutero desde el inicio de la hora actual. La entrada y la salida en estos problemas son números enteros. + +**Ejemplo de input/entrada** +190 +(6:20) + +**Ejemplo de output/salida** +120 +(20 min) + +**Theory** +Si no sabes cómo comenzar a resolver este ejercicio, revisa la teoría para este contenido: +https://snakify.org/lessons/integer_float_numbers/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file diff --git a/exercises/042-Clock face/README.md b/exercises/042-Clock face/README.md new file mode 100644 index 00000000..7c066c10 --- /dev/null +++ b/exercises/042-Clock face/README.md @@ -0,0 +1,20 @@ +# `42` Clock Face + +## 📝 Instructions: + +The hour hand of an analog clock turned α degrees since the midnight. Determine the angle by which the minute hand turned since the start of the current hour. Input and output in this problems are integers. + +**Example input** +190 +(6:20) + +**Example output** +120 +(20 min) + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/integer_float_numbers/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file diff --git a/exercises/042-Clock face/app.py b/exercises/042-Clock face/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/042-Clock face/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/043-School desks/README.es.md b/exercises/043-School desks/README.es.md new file mode 100644 index 00000000..6b7a2535 --- /dev/null +++ b/exercises/043-School desks/README.es.md @@ -0,0 +1,28 @@ +# `43` School Desks + +## 📝 Instrucciones: + +Una escuela decidió reemplazar los pupitres en tres aulas. En cada escritorio se sientan dos estudiantes. Dado el número de estudiantes en cada clase, imprime la menor cantidad posible de pupitres que se puedan comprar. + +El programa debe leer tres números enteros: el número de estudiantes en cada una de las tres clases, a, b y c respectivamente. + +En la primera prueba hay tres grupos. El primer grupo tiene 20 estudiantes y, por tanto, necesita 10 pupitres. El segundo grupo tiene 21 estudiantes, por lo que pueden arreglárselas con no menos de 11 pupitres. 11 pupitres también son suficientes para el tercer grupo de 22 estudiantes. Entonces necesitamos 32 pupitres en total. + +**Ejemplo de entrada** + +20 +21 +22 + +**Ejemplo de salida** + +32 + + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/integer_float_numbers/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file diff --git a/exercises/043-School desks/README.md b/exercises/043-School desks/README.md new file mode 100644 index 00000000..410a881a --- /dev/null +++ b/exercises/043-School desks/README.md @@ -0,0 +1,25 @@ +# `43` School Desks + +## 📝 Instructions: + +A school decided to replace the desks in three classrooms. Each desk sits two students. Given the number of students in each class, print the smallest possible number of desks that can be purchased. + +The program should read three integers: the number of students in each of the three classes, a, b and c respectively. + +In the first test there are three groups. The first group has 20 students and thus needs 10 desks. The second group has 21 students, so they can get by with no fewer than 11 desks. 11 desks is also enough for the third group of 22 students. So we need 32 desks in total. + +**Example input** +20 +21 +22 + +**Example output** +32 + + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/integer_float_numbers/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file diff --git a/exercises/043-School desks/app.py b/exercises/043-School desks/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/043-School desks/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/044-Odd or even/README.es.md b/exercises/044-Odd or even/README.es.md new file mode 100644 index 00000000..2f1f221a --- /dev/null +++ b/exercises/044-Odd or even/README.es.md @@ -0,0 +1,24 @@ +# `44` Par o Impar + +## 📝 Instrucciones: + +Dado un entero, imprime "odd" si es impar e imprime "even" si es par. + +**Ejemplo de entrada #1** +5 + +**Ejemplo de salida #1** +odd + +**Ejemplo de entrada #2** +6 + +**Ejemplo de salida #2** +even + +**Teoría** +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa la teoría de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/044-Odd or even/README.md b/exercises/044-Odd or even/README.md new file mode 100644 index 00000000..8f642b13 --- /dev/null +++ b/exercises/044-Odd or even/README.md @@ -0,0 +1,23 @@ +# `44` Odd or Even + +## 📝 Instructions: + +Given an integer, print "odd" if it's odd and print "even" otherwise. + +**Example input #1** +5 + +**Example output #1** +odd + +**Example input #2** +6 + +**Example output #2** +even + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks:https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/044-Odd or even/app.py b/exercises/044-Odd or even/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/044-Odd or even/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/045-Minimum of two numbers/README.es.md b/exercises/045-Minimum of two numbers/README.es.md new file mode 100644 index 00000000..18a815e3 --- /dev/null +++ b/exercises/045-Minimum of two numbers/README.es.md @@ -0,0 +1,20 @@ +# `45` Menor de dos Enteros + +## 📝 Instrucciones: + +Dado dos enteros, imprime el menor de ellos. + +**Ejemplo de entrada** +3 +7 + +**Ejemplo de salida** +3 + +**Theory** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/045-Minimum of two numbers/README.md b/exercises/045-Minimum of two numbers/README.md new file mode 100644 index 00000000..4d9fc549 --- /dev/null +++ b/exercises/045-Minimum of two numbers/README.md @@ -0,0 +1,19 @@ +# `45` Minimum of two numbers + +## 📝 Instructions: + +Given the two integers, print the least of them. + +**Example input** +3 +7 + +**Example output** +3 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/045-Minimum of two numbers/app.py b/exercises/045-Minimum of two numbers/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/045-Minimum of two numbers/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/046-Sign function/README.es.md b/exercises/046-Sign function/README.es.md new file mode 100644 index 00000000..e5633603 --- /dev/null +++ b/exercises/046-Sign function/README.es.md @@ -0,0 +1,21 @@ +# `46` Función de signos + +## 📝 Instrucciones: + +Dado un entero X imprime 1 si es positivo, -1 si es negativo o 0 si es igual a 0. + +Intenta usar if-elif-else. + +**Ejemplo de entrada** +179 + +**Ejemplo de salida** +1 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/046-Sign function/README.md b/exercises/046-Sign function/README.md new file mode 100644 index 00000000..3989a153 --- /dev/null +++ b/exercises/046-Sign function/README.md @@ -0,0 +1,21 @@ +# `46` Sign function + +## 📝 Instructions: + +For the given integer X print 1 if it's positive, -1 if it's negative, or 0 if it's equal to zero. + +Try to use the cascade if-elif-else for it. + +**Example input** +179 + +**Example output** +1 + +**Theory** + +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/046-Sign function/app.py b/exercises/046-Sign function/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/046-Sign function/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/047-Three-digit number/README.es.md b/exercises/047-Three-digit number/README.es.md new file mode 100644 index 00000000..191d327a --- /dev/null +++ b/exercises/047-Three-digit number/README.es.md @@ -0,0 +1,25 @@ +# `47` Número de tres dígitos + +## 📝 Instrucciones: + +Dado un entero, imprime "YES" si es un número de tres dígitos, de lo contrario imprime "NO". + +**Ejemplo de entrada #1** +179 + +**Ejemplo de salida #1** +YES + +**Ejemplo de entrada #2** +1234 + +**Ejemplo de salida #2** +NO + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/047-Three-digit number/README.md b/exercises/047-Three-digit number/README.md new file mode 100644 index 00000000..cc914819 --- /dev/null +++ b/exercises/047-Three-digit number/README.md @@ -0,0 +1,24 @@ +# `47` Three-digit number + +## 📝 Instructions: + +Given an integer, print "YES" if it's a three-digit number and print "NO" otherwise. + +**Example input #1** +179 + +**Example output #1** +YES + +**Example input #2** +1234 + +**Example output #2** +NO + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/047-Three-digit number/app.py b/exercises/047-Three-digit number/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/047-Three-digit number/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/048-Single positive/README.es.md b/exercises/048-Single positive/README.es.md new file mode 100644 index 00000000..1b0089e3 --- /dev/null +++ b/exercises/048-Single positive/README.es.md @@ -0,0 +1,27 @@ +# `48` Un solo número positivo + +## 📝 Instrucciones: + +Dado dos enteros distintos de cero, imprime "YES" si solo uno de ellos es positivo, de lo contrario imprime "NO" + +**Ejemplo de entrada #1** +-5 +10 + +**Ejemplo de salida #1** +YES + +**Ejemplo de entrada #2** +5 +10 + +**Ejemplo de salida #1** +NO + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/048-Single positive/README.md b/exercises/048-Single positive/README.md new file mode 100644 index 00000000..3198416c --- /dev/null +++ b/exercises/048-Single positive/README.md @@ -0,0 +1,27 @@ +# `48` Single Positive + +## 📝 Instructions: + +Given two non-zero integers, print "YES" if exactly one of them is positive and print "NO" otherwise. + +**Example input#1** +-5 +10 + +**Example input #1** +YES + +**Example input #2** +5 +10 + +**Example output #2** +NO + +**Theory** + +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/048-Single positive/app.py b/exercises/048-Single positive/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/048-Single positive/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/049-Ascending digits/README.es.md b/exercises/049-Ascending digits/README.es.md new file mode 100644 index 00000000..64e75524 --- /dev/null +++ b/exercises/049-Ascending digits/README.es.md @@ -0,0 +1,25 @@ +# `49` Dígitos Ascendentes + +## 📝 Instrucciones: + +Dado un entero X de tres dígitos diferentes, imprime "YES" si los tres dígitos tienen un orden ascendente de izquierda a derecha, de lo contrario imprime "NO". + +**Ejemple entrada #1** +179 + +**Ejemplo salida #1** +YES + +**Ejemple entrada #2** +197 + +**Ejemple entrada #2** +NO + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/049-Ascending digits/README.md b/exercises/049-Ascending digits/README.md new file mode 100644 index 00000000..520302ee --- /dev/null +++ b/exercises/049-Ascending digits/README.md @@ -0,0 +1,24 @@ +# `49` Ascending digits + +## 📝 Instructions: + +Given a three-digit integer X consisting of three different digits, print "YES" if its three digits are going in an ascending order from left to right and print "NO" otherwise. + +**Example input #1** +179 + +**Example output #1** +YES + +**Example input #2** +197 + +**Example output #2** +NO + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/049-Ascending digits/app.py b/exercises/049-Ascending digits/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/049-Ascending digits/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/050-Four-digit palindrome/README.es.md b/exercises/050-Four-digit palindrome/README.es.md new file mode 100644 index 00000000..638d63cb --- /dev/null +++ b/exercises/050-Four-digit palindrome/README.es.md @@ -0,0 +1,26 @@ +# `50` Palíndromo de cuatro dígitos + +## 📝 Instrucciones: + +LLamaremos a un número entero palíndromo si permanece igual luego de leer sus dígitos de derecha a izquierda, por ejemplo 07470. +Dado un entero de cuatro dígitos,imprime "YES" si es palíndromo, de lo contrario imprime "NO" + +**Ejemplo de entrada #1** +1221 + +**Ejemplo de salida #1** +YES + +**Ejemplo de entrada #2** +1234 + +**Ejemplo de salida #2** +NO + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/050-Four-digit palindrome/README.md b/exercises/050-Four-digit palindrome/README.md new file mode 100644 index 00000000..56f55f54 --- /dev/null +++ b/exercises/050-Four-digit palindrome/README.md @@ -0,0 +1,25 @@ +# `50` Four-digit palindrome + +## 📝 Instructions: + +Let's call an integer a palindrome if it remains the same after reading its digits from right to left, for example 07470. +Given a four-digit integer, print "YES" if it's a palindrome and print "NO" otherwise. + +**Example input #1** +1221 + +**Example output #1** +YES + +**Example input #2** +1234 + +**Example output #2** +NO + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/050-Four-digit palindrome/app.py b/exercises/050-Four-digit palindrome/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/050-Four-digit palindrome/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/051-Minimum of three numbers/README.es.md b/exercises/051-Minimum of three numbers/README.es.md new file mode 100644 index 00000000..b49bf667 --- /dev/null +++ b/exercises/051-Minimum of three numbers/README.es.md @@ -0,0 +1,21 @@ +# `51` Menor de tres números + +## 📝 Instrucciones: + +Dado tres enteros, imprime el menor. + +**Ejemplo de entrada** +5 +3 +7 + +**Ejemplo de salida** +3 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/051-Minimum of three numbers/README.md b/exercises/051-Minimum of three numbers/README.md new file mode 100644 index 00000000..8f004389 --- /dev/null +++ b/exercises/051-Minimum of three numbers/README.md @@ -0,0 +1,20 @@ +# `51` Minimum of three numbers + +## 📝 Instructions: + +Given three integers, print the least of them. + +**Example input** +5 +3 +7 + +**Example output** +3 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/051-Minimum of three numbers/app.py b/exercises/051-Minimum of three numbers/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/051-Minimum of three numbers/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/052-Days in month/README.es.md b/exercises/052-Days in month/README.es.md new file mode 100644 index 00000000..70517e1b --- /dev/null +++ b/exercises/052-Days in month/README.es.md @@ -0,0 +1,27 @@ +# `52` Días en el mes + +## 📝 Instrucciones: + +Dado un mes - un entero del 1 al 12, imprime la cantidad de días que tuvo en el año 2017. + +**Ejemplo de entrada #1** +1 +(Enero) + +**Ejemplo de salida #1** +31 + +**Ejemplo de entrada #2** +2 +(Febrero) + +**Ejemplo de salida #2** +28 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/052-Days in month/README.md b/exercises/052-Days in month/README.md new file mode 100644 index 00000000..872fb4c4 --- /dev/null +++ b/exercises/052-Days in month/README.md @@ -0,0 +1,26 @@ +# `52` Days in month + +## 📝 Instructions: + +Given a month - an integer from 1 to 12, print the number of days in it in the year 2017. + +**Example input #1** +1 +(January) + +**Example output #1** +31 + +**Example input #2** +2 +(February) + +**Example output #2** +28 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/052-Days in month/app.py b/exercises/052-Days in month/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/052-Days in month/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/053-Equal numbers/README.es.md b/exercises/053-Equal numbers/README.es.md new file mode 100644 index 00000000..c93afd2d --- /dev/null +++ b/exercises/053-Equal numbers/README.es.md @@ -0,0 +1,21 @@ +# `53` Números iguales + +## 📝 Instrucciones: + +Dado tres números enteros, determina cuantos de ellos son iguales. El programa debe imprimir cuantos números son iguales: 3 (si son todos iguales), 2 (si dos de ellos son iguales y uno es diferente) o 0 (si todos los números son diferentes). + +**Example input** +10 +5 +10 + +**Example output** +2 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/053-Equal numbers/README.md b/exercises/053-Equal numbers/README.md new file mode 100644 index 00000000..0023af0a --- /dev/null +++ b/exercises/053-Equal numbers/README.md @@ -0,0 +1,20 @@ +# `53` Equal numbers + +## 📝 Instructions: + +Given three integers. Determine how many of them are equal to each other. The program must print how many numbers are equal: 3 (if all are same), 2 (if two of them are equal to each other and the third one is different) or 0 (if all numbers are different). + +**Example input** +10 +5 +10 + +**Example output** +2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/053-Equal numbers/app.py b/exercises/053-Equal numbers/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/053-Equal numbers/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/054-Order of outlier/README.es.md b/exercises/054-Order of outlier/README.es.md new file mode 100644 index 00000000..b8422100 --- /dev/null +++ b/exercises/054-Order of outlier/README.es.md @@ -0,0 +1,29 @@ +# `54` Posición del número diferente + +## 📝 Instrucciones: + +Dado tres números enteros, de los cuales dos son iguales y el tercero es diferente, imprime la posición del número que es diferente - 1, 2 o 3 + +**Ejemplo de entrada #1** +10 +5 +10 + +**Ejemplo de salida #1** +2 + +**Ejemplo de entrada #2** +10 +10 +5 + +**Ejemplo de salida #2** +3 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/054-Order of outlier/README.md b/exercises/054-Order of outlier/README.md new file mode 100644 index 00000000..5b8598a8 --- /dev/null +++ b/exercises/054-Order of outlier/README.md @@ -0,0 +1,28 @@ +# `54` Order of outlier + +## 📝 Instructions: + +Given three integers, in which two are equal to each other and the third one is different. Print the position of this different one - 1, 2 or 3. + +**Example input #1** +10 +5 +10 + +**Example output #1** +2 + +**Example input #2** +10 +10 +5 + +**Example output #2** +3 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/054-Order of outlier/app.py b/exercises/054-Order of outlier/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/054-Order of outlier/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/055-Rook move/README.es.md b/exercises/055-Rook move/README.es.md new file mode 100644 index 00000000..e21b93f1 --- /dev/null +++ b/exercises/055-Rook move/README.es.md @@ -0,0 +1,24 @@ +# `55` Rook move + +## 📝 Instrucciones: + +En el ajedrez la torre se mueve horizontalmente o verticalmente. Dado dos cuadrados de un tablero de ejedrez, determina si la torre puede ir desde el primer cuadrado al segundo en una sola jugada. + +El programa recibe 4 números del 1 al 8 cada uno especificando el número de la columna y de la fila -los dos primeros corresponden al primer cuadrado y los dos últimos corresponden al segundo cuadrado (ve la imagen). La salida del programa debiera ser YES si la torre puede ir del primero cuadrado al segundo en una sola jugada, de lo contrario debe ser NO. + +**Ejemplo de entrada** +4 +4 +5 +5 + +**Ejemplo de salida** +NO + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ diff --git a/exercises/055-Rook move/README.md b/exercises/055-Rook move/README.md new file mode 100644 index 00000000..73cac02c --- /dev/null +++ b/exercises/055-Rook move/README.md @@ -0,0 +1,25 @@ +# `55` Rook move + +## 📝 Instructions: + +Chess rook moves horizontally or vertically. Given two different squares of the chessboard, determine whether a rook can go from the first square to the second one in a single move. + +The program receives four numbers from 1 to 8 each specifying the column and the row number, first two - for the first square, and the last two - for the second square (check the image). The program should output YES if a rook can go from the first square to the second one in a single move or NO otherwise. + + + +**Example input** +4 +4 +5 +5 + +**Example output** +NO + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ diff --git a/exercises/055-Rook move/Rock Move exercise.jpg b/exercises/055-Rook move/Rock Move exercise.jpg new file mode 100644 index 00000000..f1f563d7 Binary files /dev/null and b/exercises/055-Rook move/Rock Move exercise.jpg differ diff --git a/exercises/055-Rook move/app.py b/exercises/055-Rook move/app.py new file mode 100644 index 00000000..6300044f --- /dev/null +++ b/exercises/055-Rook move/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a)R \ No newline at end of file diff --git a/exercises/056-Chessboard - black square/Chessboard - black square.jpg b/exercises/056-Chessboard - black square/Chessboard - black square.jpg new file mode 100644 index 00000000..97d2d275 Binary files /dev/null and b/exercises/056-Chessboard - black square/Chessboard - black square.jpg differ diff --git a/exercises/056-Chessboard - black square/README.es.md b/exercises/056-Chessboard - black square/README.es.md new file mode 100644 index 00000000..0dcc8f58 --- /dev/null +++ b/exercises/056-Chessboard - black square/README.es.md @@ -0,0 +1,29 @@ +# `56` Tablero de ajedrez - cuadrado negro + +## 📝 Instrucciones: + +Dado un cuadrado de un tablero de ajedrez. Si es negro imprime YES, de lo contrario imprime NO. + +Este programa recibe dos números enteros del 1 al 8 cada uno especificando el número de la columna y de la fila -los dos primeros corresponden al primer cuadrado y los dos últimos corresponden al segundo cuadrado (ve la imagen). + +**Ejemplo de entrada #1** +1 +1 + +**Ejemplo de salida#1** +YES + +**Ejemplo de entrada #2** +1 +2 + +**Ejemplo de salida #2** +NO + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/056-Chessboard - black square/README.md b/exercises/056-Chessboard - black square/README.md new file mode 100644 index 00000000..d0fa1bac --- /dev/null +++ b/exercises/056-Chessboard - black square/README.md @@ -0,0 +1,30 @@ +# `56` Chessboard - black square + +## 📝 Instructions: + +Given a square of a chessboard. If it's a black square, print YES, otherwise print NO. + +The program receives two integers from 1 to 8 first two - for the first square, and the last two - for the second square(check the image). + + + +**Example input #1** +1 +1 + +**Example output #1** +YES + +**Example input #2** +1 +2 + +**Example output #2** +NO + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/056-Chessboard - black square/app.py b/exercises/056-Chessboard - black square/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/056-Chessboard - black square/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/057-Chessboard - same color/Chessboard - same color.jpg b/exercises/057-Chessboard - same color/Chessboard - same color.jpg new file mode 100644 index 00000000..97d2d275 Binary files /dev/null and b/exercises/057-Chessboard - same color/Chessboard - same color.jpg differ diff --git a/exercises/057-Chessboard - same color/README.es.md b/exercises/057-Chessboard - same color/README.es.md new file mode 100644 index 00000000..593d1b1c --- /dev/null +++ b/exercises/057-Chessboard - same color/README.es.md @@ -0,0 +1,24 @@ +# `57` Tablero de ajedrez - mismo color + +## 📝 Instrucciones: + +Dado dos cuadradoa de un tablero de ajedrez, si son del mismo color imprime YES, de lo contrario imprime NO. + +El programa recibe 4 números enteros del 1 al 8, cada uno especificando el número de la columna y de la fila -los dos primeros corresponden al primer cuadrado y los dos últimos corresponden al segundo cuadrado (ve la imagen). + +**Ejemplo de entrada** +1 +1 +2 +6 + +**Ejemplo de salida** +YES + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/057-Chessboard - same color/README.md b/exercises/057-Chessboard - same color/README.md new file mode 100644 index 00000000..ce752dba --- /dev/null +++ b/exercises/057-Chessboard - same color/README.md @@ -0,0 +1,25 @@ +# `57` Chessboard - same color + +## 📝 Instructions: + +Given two squares of a chessboard. If they are painted in the same color, print YES, otherwise print NO. + +The program receives four integers from 1 to 8, each specifying the column and row number, first two - for the first square, and then the last two - for the second square. + + + +**Example input** +1 +1 +2 +6 + +**Example output** +YES + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/057-Chessboard - same color/app.py b/exercises/057-Chessboard - same color/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/057-Chessboard - same color/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/058-King move/README.es.md b/exercises/058-King move/README.es.md new file mode 100644 index 00000000..a826b874 --- /dev/null +++ b/exercises/058-King move/README.es.md @@ -0,0 +1,25 @@ +# `58` Movida del rey + +## 📝 Instrucciones: + +En un tablero de ajedrez, el rey puede moverse un cuadrado a la vez en cualquiera dirección. Dado dos diferentes cuadrados de un tablero de ajedrez, determina si el rey puede moverse desde el primer cuadrado al segundo en una sola jugada. + +El programa recibe 4 números del 1 al 8 cada uno especificando el número de la columna y de la fila -los dos primeros corresponden al primer cuadrado y los dos últimos corresponden al segundo cuadrado. La salida del programa debe ser "YES" si el rey puede moverse desde el primer cuadrado al segundo, de lo contrario debe imprimir "NO". + + +**Ejemplo de entrada** +4 +4 +5 +5 + +**Ejemplo de salida** +YES + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ diff --git a/exercises/058-King move/README.md b/exercises/058-King move/README.md new file mode 100644 index 00000000..b881be19 --- /dev/null +++ b/exercises/058-King move/README.md @@ -0,0 +1,25 @@ +# `58` King move + +## 📝 Instructions: + +Chess king moves one square in any direction. Given two different squares of the chessboard, determine whether a king can go from the first square to the second one in a single move. + +The program receives four numbers from 1 to 8 each specifying the column and the row number, first two - for the first square, and the last two - for the second square. The program should output YES if a king can go from the first square to the second one in a single move or NO otherwise. + + + +**Example input** +4 +4 +5 +5 + +**Example output** +YES + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ diff --git a/exercises/058-King move/app.py b/exercises/058-King move/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/058-King move/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/059-Bishop move/Bishop move.jpg b/exercises/059-Bishop move/Bishop move.jpg new file mode 100644 index 00000000..b8daf8ac Binary files /dev/null and b/exercises/059-Bishop move/Bishop move.jpg differ diff --git a/exercises/059-Bishop move/README.es.md b/exercises/059-Bishop move/README.es.md new file mode 100644 index 00000000..a7b0c10c --- /dev/null +++ b/exercises/059-Bishop move/README.es.md @@ -0,0 +1,24 @@ +# `59` La movida del alfil + +## 📝 Instrucciones: + +En el ajedrez, el alfil puede avanzar tantos cuadrados como quiera pero diagonalmente. Dado dos cuadrados diferentes en el ajedrez, determina si el alfil puede ir del primer al segundo cuadrado. + +El programa recibe 4 números del 1 al 8 cada uno especificando el número de la columna y de la fila -los dos primeros corresponden al primer cuadrado y los dos últimos corresponden al segundo cuadrado. La salida del programa debe ser "YES" si el alfil puede moverse desde el primer cuadrado al segundo, de lo contrario debe imprimir "NO" + +**Ejemplo de entrada** +4 +4 +5 +5 + +**Ejemplo de salida** +YES + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/059-Bishop move/README.md b/exercises/059-Bishop move/README.md new file mode 100644 index 00000000..b6e4a3c0 --- /dev/null +++ b/exercises/059-Bishop move/README.md @@ -0,0 +1,25 @@ +# `59` Bishop move + +## 📝 Instructions: + +Chess bishop moves diagonally in any number of squares. Given two different squares of the chessboard, determine whether a bishop can go from the first square to the second one in a single move. + +The program receives four numbers from 1 to 8 each specifying the column and the row number, first two - for the first square, and the last two - for the second square. The program should output YES if a bishop can go from the first square to the second one in a single move or NO otherwise. + + + +**Example input** +4 +4 +5 +5 + +**Example output** +YES + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/059-Bishop move/app.py b/exercises/059-Bishop move/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/059-Bishop move/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/060-Queen move/Queen move.jpg b/exercises/060-Queen move/Queen move.jpg new file mode 100644 index 00000000..99645f05 Binary files /dev/null and b/exercises/060-Queen move/Queen move.jpg differ diff --git a/exercises/060-Queen move/README.es.md b/exercises/060-Queen move/README.es.md new file mode 100644 index 00000000..2324b49f --- /dev/null +++ b/exercises/060-Queen move/README.es.md @@ -0,0 +1,27 @@ +# `60` La jugada de la reina + +## 📝 Instrucciones: + +En el ajedrez, la reina puede moverse horizontal, vertical o diagonalmente cuantos cuadrados quiera. Dado dos cuadrados diferentes en el ajedrez, determina si la reina puede ir del primer al segundo cuadrado. + +El programa recibe 4 números del 1 al 8 cada uno especificando el número de la columna y de la fila -los dos primeros corresponden al primer cuadrado y los dos últimos corresponden al segundo cuadrado. La salida del programa debe ser "YES" si la reina puede moverse desde el primer cuadrado al segundo, de lo contrario debe imprimir "NO" + + + + +**Example input** +1 +1 +2 +2 + +**Example output** +YES + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/060-Queen move/README.md b/exercises/060-Queen move/README.md new file mode 100644 index 00000000..6ee9c2b5 --- /dev/null +++ b/exercises/060-Queen move/README.md @@ -0,0 +1,26 @@ +# `60` Queen move + +## 📝 Instructions: + +Chess queen moves horizontally, vertically or diagonally in any number of squares. Given two different squares of the chessboard, determine whether a queen can go from the first square to the second one in a single move. + +The program receives four numbers from 1 to 8 each specifying the column and the row number, first two - for the first square, and the last two - for the second square. The program should output YES if a queen can go from the first square to the second one in a single move or NO otherwise. + + + + +**Example input** +1 +1 +2 +2 + +**Example output** +YES + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/060-Queen move/app.py b/exercises/060-Queen move/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/060-Queen move/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/061-Knight move/README.es.md b/exercises/061-Knight move/README.es.md new file mode 100644 index 00000000..a7cee6f3 --- /dev/null +++ b/exercises/061-Knight move/README.es.md @@ -0,0 +1,26 @@ +# `61` La jugada del caballo + +## 📝 Instrucciones: + +En el aedrez, el caballo puede moverse a un cuadrado que este dos cuadrados más alla horizontalmente y un cuadrado vertical, o a dos cuadrados verticalmente y cuadrado horizontalmente. La jugada tiene forma de L. Dado dos cuadrados diferentes en el ajedrez, determina si el caballo puede ir del primer al segundo cuadrado. + +El programa recibe 4 números del 1 al 8 cada uno especificando el número de la columna y de la fila -los dos primeros corresponden al primer cuadrado y los dos últimos corresponden al segundo cuadrado. La salida del programa debe ser "YES" si el caballo puede moverse desde el primer cuadrado al segundo, de lo contrario debe imprimir "NO". + + + +**Ejemplo de entrada** +2 +4 +3 +2 + +**Ejemplo de salida** +YES + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/061-Knight move/README.md b/exercises/061-Knight move/README.md new file mode 100644 index 00000000..3e29e32e --- /dev/null +++ b/exercises/061-Knight move/README.md @@ -0,0 +1,25 @@ +# `61` Knight move + +## 📝 Instructions: + +Chess knight can move to a square that is two squares away horizontally and one square vertically, or two squares vertically and one square horizontally. The complete move therefore looks like the letter L. Given two different squares of the chessboard, determine whether a knight can go from the first square to the second one in a single move. + +The program receives four numbers from 1 to 8 each specifying the column and the row number, first two - for the first square, and the last two - for the second square. The program should output YES if a knight can go from the first square to the second one in a single move or NO otherwise. + + + +**Example input** +2 +4 +3 +2 + +**Example output** +YES + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/061-Knight move/app.py b/exercises/061-Knight move/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/061-Knight move/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/061-Knight move/knight move.jpg b/exercises/061-Knight move/knight move.jpg new file mode 100644 index 00000000..1e0a50da Binary files /dev/null and b/exercises/061-Knight move/knight move.jpg differ diff --git a/exercises/062-Leap year/README.es.md b/exercises/062-Leap year/README.es.md new file mode 100644 index 00000000..f86f9a43 --- /dev/null +++ b/exercises/062-Leap year/README.es.md @@ -0,0 +1,26 @@ +# `62` Año bisiesto + +## 📝 Instrucciones: + +Dado el número de un año, verifica si es año bisiesto o no. Si lo es imprime "LEAP", de lo contrario imprime "COMMON". + +Las reglas del calendario gregoriano son las siguientes: + +- un año es bisiesto si su número es divisible por 4 y no divisible por 100 +- un año siempre es bisiesto si es divisible por 400. + +**Nota: La palabra LEAP y COMMON deben ir en mayúscula.** + +**Ejemplo de entrada** +2012 + +**Ejemplo de salida** +LEAP + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/062-Leap year/README.md b/exercises/062-Leap year/README.md new file mode 100644 index 00000000..a6acf45c --- /dev/null +++ b/exercises/062-Leap year/README.md @@ -0,0 +1,25 @@ +# `62` Leap year + +## 📝 Instructions: + +Given the year number. You need to check if this year is a leap year. If it is, print LEAP, otherwise print COMMON. + +The rules in Gregorian calendar are as follows: + +a year is a leap year if its number is exactly divisible by 4 and is not exactly divisible by 100 +a year is always a leap year if its number is exactly divisible by 400 + +Warning. The words LEAP and COMMON should be printed all caps. + +**Example input** +2012 + +**Example output** +LEAP + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/062-Leap year/app.py b/exercises/062-Leap year/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/062-Leap year/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/063-Next day/README.es.md b/exercises/063-Next day/README.es.md new file mode 100644 index 00000000..c9abd922 --- /dev/null +++ b/exercises/063-Next day/README.es.md @@ -0,0 +1,31 @@ +# `63` Día siguiente + +## 📝 Instrucciones: + +Dado un mes (un número entero entre el 1 y el 12) y un día de él (otro número entero entre el 1 y el 31) del año 2017, imprime el mes y el día siguiente a ese. + +**Ejemplo de entrada #1** +3 +30 +(30 de marzo) + +**Ejemplo de salida #1** +3 +31 + +**Ejemplo de entrada #2** +3 +31 +(31 de marzo) + +**Ejemplo de salida #2** +4 +1 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/063-Next day/README.md b/exercises/063-Next day/README.md new file mode 100644 index 00000000..cbf846aa --- /dev/null +++ b/exercises/063-Next day/README.md @@ -0,0 +1,30 @@ +# `63` Next day + +## 📝 Instructions: + +Given a month (an integer from 1 to 12) and a day in it (an integer from 1 to 31) in the year 2017, print the month and the day of the next day to it. + +**Example input #1** +3 +30 +(March 30) + +**Example output #1** +3 +31 + +**Example input #2** +3 +31 +(March 31) + +**Example output #2** +4 +1 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/063-Next day/app.py b/exercises/063-Next day/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/063-Next day/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/064-Linear equation/README.es.md b/exercises/064-Linear equation/README.es.md new file mode 100644 index 00000000..98c088e1 --- /dev/null +++ b/exercises/064-Linear equation/README.es.md @@ -0,0 +1,27 @@ +# `64` Ecuación Lineal + +## 📝 Instrucciones: + +Escribe un programa que resuelva una ecuación lineal ax = b en enteros. Dado dos enteros a y b (y quizas un cero), imprime la raíz: sólo número entero de raíz si es que existe, de lo contrario escribe "no solution" si no tienee solución o "many solutions" si tiene múltiples soluciones. + +**Ejemplo de entrada #1** +1 +-2 + +**Ejemplo de salida #1** +-2 + +**Ejemplo de entrada #2** +2 +-1 + +**Ejemplo de salida #2** +no solution + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/064-Linear equation/README.md b/exercises/064-Linear equation/README.md new file mode 100644 index 00000000..5f60c6a8 --- /dev/null +++ b/exercises/064-Linear equation/README.md @@ -0,0 +1,26 @@ +# `64` Linear equation + +## 📝 Instructions: + +Write a program that solves a linear equation ax = b in integers. Given two integers a and b (a may be zero), print a single integer root if it exists and print "no solution" or "many solutions" otherwise. + +**Example input #1** +1 +-2 + +**Example output #1** +-2 + +**Example input #2** +2 +-1 + +**Example output #2** +no solution + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/064-Linear equation/app.py b/exercises/064-Linear equation/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/064-Linear equation/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/065-Minimum of five numbers/README.es.md b/exercises/065-Minimum of five numbers/README.es.md new file mode 100644 index 00000000..fd62ab9d --- /dev/null +++ b/exercises/065-Minimum of five numbers/README.es.md @@ -0,0 +1,23 @@ +# `65` El menor de cinco números + +## 📝 Instrucciones: + +Dado cinco números enteros, imprime el menor. + +**Ejemplo entrada** +10 +20 +30 +40 +50 + +**Ejemplo de salida** +10 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/065-Minimum of five numbers/README.md b/exercises/065-Minimum of five numbers/README.md new file mode 100644 index 00000000..3a335ddf --- /dev/null +++ b/exercises/065-Minimum of five numbers/README.md @@ -0,0 +1,22 @@ +# `65` Minimum of five numbers + +## 📝 Instructions: + +Given five integers, print the least of them. + +**Example input** +10 +20 +30 +40 +50 + +**Example output** +10 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/066-Vertices of rectangle/README.es.md b/exercises/066-Vertices of rectangle/README.es.md new file mode 100644 index 00000000..6ac26113 --- /dev/null +++ b/exercises/066-Vertices of rectangle/README.es.md @@ -0,0 +1,39 @@ +# `66` Vértices de un rectángulo + +## 📝 Instrucciones: + +Dadas las coordenadas enteras de tres vértices de un rectángulo cuyos lados son paralelos a los ejes de coordenadas, encuentra las coordenadas del cuarto vértice del rectángulo. + + +**Ejemplo de entrada #1** +1 +5 +7 +5 +1 +10 +los tres vértices son (1, 5), (7, 5), (1, 10) + +**Ejemplo de salida #1** +7 +10 + +**Ejemplo de entrada #2** +1 +5 +7 +10 +1 +10 + +**Ejemplo de salida #2** +7 +5 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/066-Vertices of rectangle/README.md b/exercises/066-Vertices of rectangle/README.md new file mode 100644 index 00000000..707322e3 --- /dev/null +++ b/exercises/066-Vertices of rectangle/README.md @@ -0,0 +1,38 @@ +# `66` Vertices of rectangle + +## 📝 Instructions: + +Given integer coordinates of three vertices of a rectangle whose sides are parallel to coordinate axes, find the coordinates of the fourth vertex of the rectangle. + + +**Example input #1** +1 +5 +7 +5 +1 +10 +three vertices are (1, 5), (7, 5), (1, 10) + +**Example output #1** +7 +10 + +**Example input #2** +1 +5 +7 +10 +1 +10 + +**Example output #2** +7 +5 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/066-Vertices of rectangle/app.py b/exercises/066-Vertices of rectangle/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/066-Vertices of rectangle/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/067-Sort three numbers/README.es.md b/exercises/067-Sort three numbers/README.es.md new file mode 100644 index 00000000..509aaa0e --- /dev/null +++ b/exercises/067-Sort three numbers/README.es.md @@ -0,0 +1,23 @@ +# `67` Ordena tres números + +## 📝 Instrucciones: + +Dado tres enteros, imprímelos en orden ascendente. + +**Ejemplo de entrada** +5 +3 +7 + +**Ejemplo de salida** +3 +5 +7 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/if_then_else_conditions/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/067-Sort three numbers/README.md b/exercises/067-Sort three numbers/README.md new file mode 100644 index 00000000..267b201c --- /dev/null +++ b/exercises/067-Sort three numbers/README.md @@ -0,0 +1,22 @@ +# `67` Sort three numbers + +## 📝 Instructions: + +Given three integers, print them in ascending order. + +**Example input** +5 +3 +7 + +**Example output** +3 +5 +7 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/if_then_else_conditions/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/if_then_else_conditions/steps/1/ \ No newline at end of file diff --git a/exercises/067-Sort three numbers/app.py b/exercises/067-Sort three numbers/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/067-Sort three numbers/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/068-Series - 1/README.es.md b/exercises/068-Series - 1/README.es.md new file mode 100644 index 00000000..3117735c --- /dev/null +++ b/exercises/068-Series - 1/README.es.md @@ -0,0 +1,21 @@ +# `68` Series - 1 + +## 📝 Instrucciones: + +Dado dos números enteros A y (A ≤ B). Imprime todos los números de A y B (A y B inclusive). + + +**Ejemplo de entrada** +1 +10 + +**Ejemplo de salida** +1 2 3 4 5 6 7 8 9 10 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/for_loop_range/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/068-Series - 1/README.md b/exercises/068-Series - 1/README.md new file mode 100644 index 00000000..8c9071d1 --- /dev/null +++ b/exercises/068-Series - 1/README.md @@ -0,0 +1,19 @@ +# `68` Series - 1 + +## 📝 Instructions: + +Given two integers A and B (A ≤ B). Print all numbers from A to B inclusively. + +**Example input** +1 +10 + +**Example output** +1 2 3 4 5 6 7 8 9 10 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/for_loop_range/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/068-Series - 1/app.py b/exercises/068-Series - 1/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/068-Series - 1/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/069-Series - 2/README.es.md b/exercises/069-Series - 2/README.es.md new file mode 100644 index 00000000..8236ed85 --- /dev/null +++ b/exercises/069-Series - 2/README.es.md @@ -0,0 +1,21 @@ +# `69` Series - 2 + +## 📝 Instrucciones: + +Dado dos números enteros A y B, imprime todos los números de A a B incluidos, en un orden ascendente, si A < B, y en orden descendente si A ≥ B. + + +**Ejemplo de entrada** +8 +5 + +**Ejemplo de salida** +8 7 6 5 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/for_loop_range/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/069-Series - 2/README.md b/exercises/069-Series - 2/README.md new file mode 100644 index 00000000..3dc72b1b --- /dev/null +++ b/exercises/069-Series - 2/README.md @@ -0,0 +1,19 @@ +# `69` Series - 2 + +## 📝 Instructions: + +Given two integers A and B. Print all numbers from A to B inclusively, in increasing order, if A < B, or in decreasing order, if A ≥ B. + +**Example input** +8 +5 + +**Example output** +8 7 6 5 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/for_loop_range/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/069-Series - 2/app.py b/exercises/069-Series - 2/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/069-Series - 2/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/070-Sum of ten numbers/README.es.md b/exercises/070-Sum of ten numbers/README.es.md new file mode 100644 index 00000000..1b52391f --- /dev/null +++ b/exercises/070-Sum of ten numbers/README.es.md @@ -0,0 +1,28 @@ +# `70` Suma de diez números + +## 📝 Instrucciones: + +Dado 10 números de entrada; léelos e imprime su suma. Usa la menor cantidad de variables posibles. + +**Ejemplo de entrada** +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 + +**Ejemplo de entrada** +45 + +**Teoría** + +Si no sabes por donde empezar a resolver este ejercicio, por favor revisa el contenido de esta lección: +https://snakify.org/lessons/for_loop_range/ + +También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/070-Sum of ten numbers/README.md b/exercises/070-Sum of ten numbers/README.md new file mode 100644 index 00000000..d842812e --- /dev/null +++ b/exercises/070-Sum of ten numbers/README.md @@ -0,0 +1,27 @@ +# `70` Sum of ten numbers + +## 📝 Instructions: + +10 numbers are given in the input. Read them and print their sum. Use as few variables as you can. + +**Example input** +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 + +**Example output** +45 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/for_loop_range/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/070-Sum of ten numbers/app.py b/exercises/070-Sum of ten numbers/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/070-Sum of ten numbers/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/071-Sum of N numbers/README.md b/exercises/071-Sum of N numbers/README.md new file mode 100644 index 00000000..d13f7b68 --- /dev/null +++ b/exercises/071-Sum of N numbers/README.md @@ -0,0 +1,30 @@ +# `71` Sum of N numbers + +## 📝 Instructions: + +N numbers are given in the input. Read them and print their sum. + +The first line of input contains the integer N, which is the number of integers to follow. Each of the next N lines contains one integer. Print the sum of these N integers. + +**Example input** +10 +1 +2 +1 +1 +1 +1 +3 +1 +1 +1 + +**Example output** +13 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/for_loop_range/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/071-Sum of N numbers/app.py b/exercises/071-Sum of N numbers/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/071-Sum of N numbers/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/072-Sum of cubes/README.md b/exercises/072-Sum of cubes/README.md new file mode 100644 index 00000000..bef5406c --- /dev/null +++ b/exercises/072-Sum of cubes/README.md @@ -0,0 +1,20 @@ +# `72` Sum of cubes + +## 📝 Instructions: + +For the given integer N calculate the following sum: + +1³ + 2³ + ... + N³ + +**Example input** +3 + +**Example output** +36 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/for_loop_range/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/072-Sum of cubes/app.py b/exercises/072-Sum of cubes/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/072-Sum of cubes/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/073-Number of zeros/README.md b/exercises/073-Number of zeros/README.md new file mode 100644 index 00000000..f255da6b --- /dev/null +++ b/exercises/073-Number of zeros/README.md @@ -0,0 +1,25 @@ +# `73` Number of zeros + +## 📝 Instructions: + +Given N numbers: the first number in the input is N, after that N integers are given. Count the number of zeros among the given integers and print it. + +You need to count the number of numbers that are equal to zero, not the number of zero digits. + +**Example input** +5 +0 +700 +0 +200 +2 + +**Example output** +2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/for_loop_range/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/073-Number of zeros/app.py b/exercises/073-Number of zeros/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/073-Number of zeros/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/074-Sum of factorials/README.md b/exercises/074-Sum of factorials/README.md new file mode 100644 index 00000000..26729a4c --- /dev/null +++ b/exercises/074-Sum of factorials/README.md @@ -0,0 +1,26 @@ +# `74` Sum of factorials + +## 📝 Instructions: + +In mathematics, the factorial of an integer n, denoted by n! is the following product: + +n! = 1 × 2 × … × n + +For the given integer n calculate the value + +1! + 2! + 3! + ... + n! + +Try to discover the solution that uses only one for-loop. And don't use math module in this exercise. + +**Example input** +4 + +**Example output** +33 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/for_loop_range/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/074-Sum of factorials/app.py b/exercises/074-Sum of factorials/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/074-Sum of factorials/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/075-Lost card/README.md b/exercises/075-Lost card/README.md new file mode 100644 index 00000000..00875163 --- /dev/null +++ b/exercises/075-Lost card/README.md @@ -0,0 +1,24 @@ + # `75` Lost card + +## 📝 Instructions: + +There was a set of cards with numbers from 1 to N. One of the card is now lost. Determine the number on that lost card given the numbers for the remaining cards. + +Given a number N, followed by N − 1 integers representing the numbers on the remaining cards (distinct integers in the range from 1 to N). Find and print the number on the lost card. + +**Example input** +5 +3 +5 +2 +1 + +**Example output** +4 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/for_loop_range/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/075-Lost card/app.py b/exercises/075-Lost card/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/075-Lost card/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/076-Ladder/README.md b/exercises/076-Ladder/README.md new file mode 100644 index 00000000..666ae457 --- /dev/null +++ b/exercises/076-Ladder/README.md @@ -0,0 +1,22 @@ + # `76` Ladder + +## 📝 Instructions: + +For given integer n ≤ 9 print a ladder of n steps. The k-th step consists of the integers from 1 to k without spaces between them. + +To do that, you can use the sep and end arguments for the function print(). + +**Example input** +3 + +**Example output** +1 +12 +123 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/for_loop_range/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/for_loop_range/steps/1/ \ No newline at end of file diff --git a/exercises/076-Ladder/app.py b/exercises/076-Ladder/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/076-Ladder/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/077-Slices/README.md b/exercises/077-Slices/README.md new file mode 100644 index 00000000..c78eee83 --- /dev/null +++ b/exercises/077-Slices/README.md @@ -0,0 +1,37 @@ + # `77` Slices + +## 📝 Instructions: + +You are given a string. + +In the first line, print the third character of this string. +In the second line, print the second to last character of this string. +In the third line, print the first five characters of this string. +In the fourth line, print all but the last two characters of this string. +In the fifth line, print all the characters of this string with even indices (remember indexing starts at 0, so the characters are displayed starting with the first). +In the sixth line, print all the characters of this string with odd indices (i.e. starting with the second character in the string). +In the seventh line, print all the characters of the string in reverse order. +In the eighth line, print every second character of the string in reverse order, starting from the last one. +In the ninth line, print the length of the given string. + + +**Example input** +Abrakadabra + +**Example output** +r +r +Abrak +Abrakadab +Arkdba +baaar +arbadakarbA +abdkrA +11 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/077-Slices/app.py b/exercises/077-Slices/app.py new file mode 100644 index 00000000..b802a870 --- /dev/null +++ b/exercises/077-Slices/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) \ No newline at end of file diff --git a/exercises/078-Number of words/README.md b/exercises/078-Number of words/README.md new file mode 100644 index 00000000..e571a62f --- /dev/null +++ b/exercises/078-Number of words/README.md @@ -0,0 +1,18 @@ + # `78` Number of words + +## 📝 Instructions: + +Given a string consisting of words separated by spaces. Determine how many words it has. To solve the problem, use the method count. + +**Example input** +Hello world + +**Example output** +2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/078-Number of words/app.py b/exercises/078-Number of words/app.py new file mode 100644 index 00000000..b802a870 --- /dev/null +++ b/exercises/078-Number of words/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) \ No newline at end of file diff --git a/exercises/079-Two halves/README.md b/exercises/079-Two halves/README.md new file mode 100644 index 00000000..a3ccb223 --- /dev/null +++ b/exercises/079-Two halves/README.md @@ -0,0 +1,20 @@ + # `79` Two halves + +## 📝 Instructions: + +Given a string, cut it into two equal parts. If the length of the string is odd, leave the middle character within the first chunk, so that the first string contains one more character than the second. Now print a new string on a single row with the first and second halves swapped: second half first and the first half last. + +Can you solve it without using if? + +**Example input** +Qwerty + +**Example output** +rtyQwe + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/079-Two halves/app.py b/exercises/079-Two halves/app.py new file mode 100644 index 00000000..15a81d50 --- /dev/null +++ b/exercises/079-Two halves/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) diff --git a/exercises/080-Swap two words/README.md b/exercises/080-Swap two words/README.md new file mode 100644 index 00000000..f74f342d --- /dev/null +++ b/exercises/080-Swap two words/README.md @@ -0,0 +1,20 @@ + # `80` Swap two words + +## 📝 Instructions: + +Given a string consisting of exactly two words separated by a space. Print a new string with the first and second words swapped: the second word is printed first. Consider all adjacent non-space characters a single word. + +Can you solve it without using if-else and loops? + +**Example input** +Hello, world! + +**Example output** +world! Hello, + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/080-Swap two words/app.py b/exercises/080-Swap two words/app.py new file mode 100644 index 00000000..15a81d50 --- /dev/null +++ b/exercises/080-Swap two words/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) diff --git a/exercises/081-First and last occurrence/README.md b/exercises/081-First and last occurrence/README.md new file mode 100644 index 00000000..c8e1d747 --- /dev/null +++ b/exercises/081-First and last occurrence/README.md @@ -0,0 +1,30 @@ + # `81` First and last occurrence + +## 📝 Instructions: + +Given a string that may contain a letter f. Print the index of the first and last occurrence of f. If the letter f occurs only once, then output its index once. If the letter f does not occur, print -1. + +**Example input #1** +comfort + +**Example output #1** +3 + +**Example input #2** +office + +**Example output #2** +1 2 + +**Example input #3** +hello + +**Example output #3** +-1 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/081-First and last occurrence/app.py b/exercises/081-First and last occurrence/app.py new file mode 100644 index 00000000..15a81d50 --- /dev/null +++ b/exercises/081-First and last occurrence/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) diff --git a/exercises/082-Second occurrence/README.md b/exercises/082-Second occurrence/README.md new file mode 100644 index 00000000..c1c70720 --- /dev/null +++ b/exercises/082-Second occurrence/README.md @@ -0,0 +1,30 @@ + # `82` Second occurrence + +## 📝 Instructions: + +Given a string that may contain a letter p. Print the index of the second occurrence of p. If the letter p occurs only once, then print -1, and if the string does not contain the letter p, then print -2. + +**Example input #1** +appropriate + +**Example output #1** +2 + +**Example input #2** +spare + +**Example output #2** +-1 + +**Example input #3** +reason + +**Example output #3** +-2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/082-Second occurrence/app.py b/exercises/082-Second occurrence/app.py new file mode 100644 index 00000000..b802a870 --- /dev/null +++ b/exercises/082-Second occurrence/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) \ No newline at end of file diff --git a/exercises/083-Remove fragment/README.md b/exercises/083-Remove fragment/README.md new file mode 100644 index 00000000..58e932a2 --- /dev/null +++ b/exercises/083-Remove fragment/README.md @@ -0,0 +1,18 @@ + # `83` Remove fragment + +## 📝 Instructions: + +Given a string in which the letter h occurs at least twice. Remove from that string the first and the last occurrence of the letter h, as well as all the characters between them. + +**Example input** +In the hole in the ground there lived a hobbit + +**Example output** +In tobbit + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/083-Remove fragment/app.py b/exercises/083-Remove fragment/app.py new file mode 100644 index 00000000..b802a870 --- /dev/null +++ b/exercises/083-Remove fragment/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) \ No newline at end of file diff --git a/exercises/084-Reverse fragment/README.md b/exercises/084-Reverse fragment/README.md new file mode 100644 index 00000000..1ef9107d --- /dev/null +++ b/exercises/084-Reverse fragment/README.md @@ -0,0 +1,18 @@ + # `84` Reverse fragment + +## 📝 Instructions: + +Given a string in which the letter h occurs at least twice, reverse the sequence of characters enclosed between the first and last occurrences of it. + +**Example input** +In the hole in the ground there lived a hobbit + +**Example output** +In th a devil ereht dnuorg eht ni eloh ehobbit + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/084-Reverse fragment/app.py b/exercises/084-Reverse fragment/app.py new file mode 100644 index 00000000..b802a870 --- /dev/null +++ b/exercises/084-Reverse fragment/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) \ No newline at end of file diff --git a/exercises/085-Replace/README.md b/exercises/085-Replace/README.md new file mode 100644 index 00000000..a696e066 --- /dev/null +++ b/exercises/085-Replace/README.md @@ -0,0 +1,18 @@ + # `85` Replace + +## 📝 Instructions: + +Given a string. Replace in this string all the numbers 1 by the word one. + +**Example input** +1+1=2 + +**Example output** +one+one=2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/085-Replace/app.py b/exercises/085-Replace/app.py new file mode 100644 index 00000000..b802a870 --- /dev/null +++ b/exercises/085-Replace/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) \ No newline at end of file diff --git a/exercises/086-Delete character/README.md b/exercises/086-Delete character/README.md new file mode 100644 index 00000000..0a921d62 --- /dev/null +++ b/exercises/086-Delete character/README.md @@ -0,0 +1,18 @@ + # `86` Delete character + +## 📝 Instructions: + +Given a string, delete all the characters @ from this string. + +**Example input** +Bilbo.Baggins@bagend.hobbiton.shire.me + +**Example output** +Bilbo.Bagginsbagend.hobbiton.shire.me + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/086-Delete character/app.py b/exercises/086-Delete character/app.py new file mode 100644 index 00000000..b802a870 --- /dev/null +++ b/exercises/086-Delete character/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) \ No newline at end of file diff --git a/exercises/087-Replace in fragment/README.md b/exercises/087-Replace in fragment/README.md new file mode 100644 index 00000000..c575a8fc --- /dev/null +++ b/exercises/087-Replace in fragment/README.md @@ -0,0 +1,18 @@ + # `87` Replace in fragment + +## 📝 Instructions: + +Given a string in which the letter h occurs at least twice, replace every occurrence of the letter h by the letter H, except for the first and the last ones. + +**Example input** +In the hole in the ground there lived a hobbit + +**Example output** +In the Hole in tHe ground tHere lived a hobbit + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/087-Replace in fragment/app.py b/exercises/087-Replace in fragment/app.py new file mode 100644 index 00000000..b802a870 --- /dev/null +++ b/exercises/087-Replace in fragment/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) \ No newline at end of file diff --git a/exercises/088-Delete every third character/README.md b/exercises/088-Delete every third character/README.md new file mode 100644 index 00000000..7c8fecc4 --- /dev/null +++ b/exercises/088-Delete every third character/README.md @@ -0,0 +1,18 @@ + # `88` Delete every third character + +## 📝 Instructions: + +Given a string, delete all its characters whose indices are divisible by 3. + +**Example input** +Python + +**Example output** +yton + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/strings_str/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/strings_str/steps/1/ \ No newline at end of file diff --git a/exercises/088-Delete every third character/app.py b/exercises/088-Delete every third character/app.py new file mode 100644 index 00000000..15a81d50 --- /dev/null +++ b/exercises/088-Delete every third character/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a string: +# print(s) diff --git a/exercises/089-List of squares/README.md b/exercises/089-List of squares/README.md new file mode 100644 index 00000000..6629f580 --- /dev/null +++ b/exercises/089-List of squares/README.md @@ -0,0 +1,18 @@ + # `89` List of squares + +## 📝 Instructions: + +For a given integer N, print all the squares of positive integers where the square is less than or equal to N, in ascending order. + +**Example input** +50 + +**Example output** +1 4 9 16 25 36 49 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/089-List of squares/app.py b/exercises/089-List of squares/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/089-List of squares/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/090-Least divisor/README.md b/exercises/090-Least divisor/README.md new file mode 100644 index 00000000..4e592328 --- /dev/null +++ b/exercises/090-Least divisor/README.md @@ -0,0 +1,18 @@ + # `90` Least divisor + +## 📝 Instructions: + +Given an integer not less than 2. Print its smallest integer divisor greater than 1. + +**Example input** +15 + +**Example output** +3 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/090-Least divisor/app.py b/exercises/090-Least divisor/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/090-Least divisor/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/091-Power of two/README.md b/exercises/091-Power of two/README.md new file mode 100644 index 00000000..9dad1840 --- /dev/null +++ b/exercises/091-Power of two/README.md @@ -0,0 +1,18 @@ + # `91` Power of two + +## 📝 Instructions: + +For a given integer X, find the greatest integer n where 2ⁿ is less than or equal to X. Print the exponent value and the result of the expression 2ⁿ. + +**Example input** +50 + +**Example output** +5 32 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/091-Power of two/app.py b/exercises/091-Power of two/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/091-Power of two/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/092-Jogging/README.md b/exercises/092-Jogging/README.md new file mode 100644 index 00000000..4fdd9df0 --- /dev/null +++ b/exercises/092-Jogging/README.md @@ -0,0 +1,23 @@ + # `92` Jogging + +## 📝 Instructions: + +As a future athlete you just started your practice for an upcoming event. On the first day you run x miles, and by the day of the event you must be able to run y miles. + +Calculate the number of days required for you to finally reach the required distance for the event, if you increases your distance each day by 10% from the previous day. + +Print one integer representing the number of days to reach the required distance. + +**Example input** +10 +30 + +**Example output** +13 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/092-Jogging/app.py b/exercises/092-Jogging/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/092-Jogging/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/093-Length of sequence/README.md b/exercises/093-Length of sequence/README.md new file mode 100644 index 00000000..35fda5d5 --- /dev/null +++ b/exercises/093-Length of sequence/README.md @@ -0,0 +1,22 @@ + # `93` Length of sequence + +## 📝 Instructions: + +Given a sequence of non-negative integers, where each number is written in a separate line. Determine the length of the sequence. The sequence ends with 0. Print the length of the sequence (not counting the 0). The numbers following the number 0 should be omitted. + +**Example input** +1 +7 +9 +0 +5 + +**Example output** +3 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/093-Length of sequence/app.py b/exercises/093-Length of sequence/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/093-Length of sequence/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/094-Sum of sequence/README.md b/exercises/094-Sum of sequence/README.md new file mode 100644 index 00000000..a14bee21 --- /dev/null +++ b/exercises/094-Sum of sequence/README.md @@ -0,0 +1,21 @@ + # `94` Sum of sequence + +## 📝 Instructions: + +Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the sum of the sequence. + +**Example input** +1 +7 +9 +0 + +**Example output** +17 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/094-Sum of sequence/app.py b/exercises/094-Sum of sequence/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/094-Sum of sequence/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/095-Average of sequence/README.md b/exercises/095-Average of sequence/README.md new file mode 100644 index 00000000..317064c7 --- /dev/null +++ b/exercises/095-Average of sequence/README.md @@ -0,0 +1,20 @@ + # `95` Average of sequence + +## 📝 Instructions: + +Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the average of the sequence. + +**Example input** +10 +30 +0 + +**Example output** +20.0 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/095-Average of sequence/app.py b/exercises/095-Average of sequence/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/095-Average of sequence/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/096-Maximum of sequence/README.md b/exercises/096-Maximum of sequence/README.md new file mode 100644 index 00000000..7a22661e --- /dev/null +++ b/exercises/096-Maximum of sequence/README.md @@ -0,0 +1,23 @@ + # `96` Maximum of sequence + +## 📝 Instructions: + +Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the maximum of the sequence. + +**Example input** +1 +2 +3 +2 +1 +0 + +**Example output** +3 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/096-Maximum of sequence/app.py b/exercises/096-Maximum of sequence/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/096-Maximum of sequence/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/097-Index of maximum/README.md b/exercises/097-Index of maximum/README.md new file mode 100644 index 00000000..f80a103a --- /dev/null +++ b/exercises/097-Index of maximum/README.md @@ -0,0 +1,22 @@ + # `97` Index of maximum + +## 📝 Instructions: + +Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the index of the first maximum of the sequence. + +**Example input** +1 +7 +9 +5 +0 + +**Example output** +3 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/097-Index of maximum/app.py b/exercises/097-Index of maximum/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/097-Index of maximum/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/098-Number of even elements/README.md b/exercises/098-Number of even elements/README.md new file mode 100644 index 00000000..67271cf1 --- /dev/null +++ b/exercises/098-Number of even elements/README.md @@ -0,0 +1,21 @@ + # `98` Number of even elements + +## 📝 Instructions: + +Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the number of even elements of the sequence. + +**Example input** +2 +1 +4 +0 + +**Example output** +2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/098-Number of even elements/app.py b/exercises/098-Number of even elements/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/098-Number of even elements/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/099-Greater than previous/README.md b/exercises/099-Greater than previous/README.md new file mode 100644 index 00000000..c6725595 --- /dev/null +++ b/exercises/099-Greater than previous/README.md @@ -0,0 +1,23 @@ + # `99` Greater than previous + +## 📝 Instructions: + +Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the number of elements of the sequence that are greater than their neighbors above. + +**Example input** +1 +2 +3 +4 +5 +0 + +**Example output** +4 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/099-Greater than previous/app.py b/exercises/099-Greater than previous/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/099-Greater than previous/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/100-Second maximum/README.md b/exercises/100-Second maximum/README.md new file mode 100644 index 00000000..fd883805 --- /dev/null +++ b/exercises/100-Second maximum/README.md @@ -0,0 +1,21 @@ + # `100` Second maximum + +## 📝 Instructions: + +Given a sequence of distinct non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the second largest element in this sequence. It is guaranteed that the sequence has at least two elements. + +**Example input** +1 +7 +9 +0 + +**Example output** +7 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/100-Second maximum/app.py b/exercises/100-Second maximum/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/100-Second maximum/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/101-Number of maxima/README.md b/exercises/101-Number of maxima/README.md new file mode 100644 index 00000000..645e6592 --- /dev/null +++ b/exercises/101-Number of maxima/README.md @@ -0,0 +1,31 @@ + # `101` Number of maxima + +## 📝 Instructions: + +Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Find how many elements of this sequence are equal to its largest element. + +**Example input #1** +1 +7 +9 +0 + +**Example output #1** +1 + +**Example input #2** +1 +3 +3 +1 +0 + +**Example output #2** +2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/101-Number of maxima/app.py b/exercises/101-Number of maxima/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/101-Number of maxima/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/102-Widest fragment/README.md b/exercises/102-Widest fragment/README.md new file mode 100644 index 00000000..f8cf91ae --- /dev/null +++ b/exercises/102-Widest fragment/README.md @@ -0,0 +1,23 @@ + # `102` Widest fragment + +## 📝 Instructions: + +Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Determine the length of the widest fragment where all the elements are equal to each other. + +**Example input** +1 +7 +7 +9 +1 +0 + +**Example output** +2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/102-Widest fragment/app.py b/exercises/102-Widest fragment/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/102-Widest fragment/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/103-Fibonacci numbers/README.md b/exercises/103-Fibonacci numbers/README.md new file mode 100644 index 00000000..8c682b57 --- /dev/null +++ b/exercises/103-Fibonacci numbers/README.md @@ -0,0 +1,22 @@ + # `103` Fibonacci numbers + +## 📝 Instructions: + +Fibonacci numbers are the numbers in the integer sequence starting with 1, 1 where every number after the first two is the sum of the two preceding ones: + +1, 1, 2, 3, 5, 8, 13, 21, 34, ... + +Given a positive integer n, print the nth Fibonacci number. + +**Example input** +6 + +**Example output** +8 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/103-Fibonacci numbers/app.py b/exercises/103-Fibonacci numbers/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/103-Fibonacci numbers/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/104-Fibonacci index/README.md b/exercises/104-Fibonacci index/README.md new file mode 100644 index 00000000..fc73db0e --- /dev/null +++ b/exercises/104-Fibonacci index/README.md @@ -0,0 +1,22 @@ + # `104` Fibonacci index + +## 📝 Instructions: + +Fibonacci numbers are the numbers in the integer sequence starting with 1, 1 where every number after the first two is the sum of the two preceding ones: + +1, 1, 2, 3, 5, 8, 13, 21, 34, ... + +Given a positive integer, determine if it's the nth Fibonacci number for some n. If it is, print such n, otherwise print -1. + +**Example input** +8 + +**Example output**a +6 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/while_loop/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/while_loop/steps/1/ \ No newline at end of file diff --git a/exercises/104-Fibonacci index/app.py b/exercises/104-Fibonacci index/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/104-Fibonacci index/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/105-Even indices/README.md b/exercises/105-Even indices/README.md new file mode 100644 index 00000000..544d1c2d --- /dev/null +++ b/exercises/105-Even indices/README.md @@ -0,0 +1,18 @@ + # `105` Even indices + +## 📝 Instructions: + +Given a list of numbers, find and print all its elements with even indices (i.e. A[0], A[2], A[4], ...). + +**Example input** +5 6 7 8 9 + +**Example output** +5 7 9 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/105-Even indices/app.py b/exercises/105-Even indices/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/105-Even indices/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/106-Even elements/README.md b/exercises/106-Even elements/README.md new file mode 100644 index 00000000..98dd4d35 --- /dev/null +++ b/exercises/106-Even elements/README.md @@ -0,0 +1,18 @@ + # `106` Even elements + +## 📝 Instructions: + +Given a list of numbers, print all its even elements. Use a for-loop that iterates over the list itself and not over its indices. That is, don't use range() + +**Example input** +1 2 2 3 3 3 4 + +**Example output** +2 2 4 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/106-Even elements/app.py b/exercises/106-Even elements/app.py new file mode 100644 index 00000000..d3cf4f97 --- /dev/null +++ b/exercises/106-Even elements/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/107-Greater than left neighbor/README.md b/exercises/107-Greater than left neighbor/README.md new file mode 100644 index 00000000..a18f8f4e --- /dev/null +++ b/exercises/107-Greater than left neighbor/README.md @@ -0,0 +1,18 @@ + # `107` Greater than left neighbor + +## 📝 Instructions: + +Given a list of numbers, find and print all its elements that are greater than their left neighbor. + +**Example input** +1 5 2 4 3 + +**Example output** +5 4 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/107-Greater than left neighbor/app.py b/exercises/107-Greater than left neighbor/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/107-Greater than left neighbor/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/108-Same sign neighbors/README.md b/exercises/108-Same sign neighbors/README.md new file mode 100644 index 00000000..93991b97 --- /dev/null +++ b/exercises/108-Same sign neighbors/README.md @@ -0,0 +1,24 @@ + # `108` Same sign neighbors + +## 📝 Instructions: + +Given a list of non-zero integers, find and print the first adjacent pair of elements that have the same sign. If there is no such pair, print 0. + +**Example input #1** +-1 2 3 -1 -2 + +**Example output #1** +2 3 + +**Example input #2** +1 -3 4 -2 1 + +**Example output #2** +0 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/108-Same sign neighbors/app.py b/exercises/108-Same sign neighbors/app.py new file mode 100644 index 00000000..d3cf4f97 --- /dev/null +++ b/exercises/108-Same sign neighbors/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/109-Greater than neighbors/README.md b/exercises/109-Greater than neighbors/README.md new file mode 100644 index 00000000..9da58439 --- /dev/null +++ b/exercises/109-Greater than neighbors/README.md @@ -0,0 +1,20 @@ + # `109` Greater than neighbors + +## 📝 Instructions: + +Given a list of numbers, determine and print the number of elements that are greater than both of their neighbors. + +The first and the last items of the list shouldn't be considered because they don't have two neighbors. + +**Example input** +1 5 1 5 1 + +**Example output** +2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/109-Greater than neighbors/app.py b/exercises/109-Greater than neighbors/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/109-Greater than neighbors/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/110-Number of distinct elements/README.md b/exercises/110-Number of distinct elements/README.md new file mode 100644 index 00000000..6bdcf1c9 --- /dev/null +++ b/exercises/110-Number of distinct elements/README.md @@ -0,0 +1,18 @@ + # `110` Number of distinct elements + +## 📝 Instructions: + +Given a list of numbers with all elements sorted in ascending order, determine and print the number of distinct elements in it. + +**Example input** +1 2 2 3 3 3 + +**Example output** +3 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/110-Number of distinct elements/app.py b/exercises/110-Number of distinct elements/app.py new file mode 100644 index 00000000..d3cf4f97 --- /dev/null +++ b/exercises/110-Number of distinct elements/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/111-Swap neighbors/README.md b/exercises/111-Swap neighbors/README.md new file mode 100644 index 00000000..131f8493 --- /dev/null +++ b/exercises/111-Swap neighbors/README.md @@ -0,0 +1,18 @@ + # `111` Swap neighbors + +## 📝 Instructions: + +Given a list of numbers, swap adjacent elements in each pair (swap A[0] with A[1], A[2] with A[3], etc.). Print the resulting list. If a list has an odd number of elements, leave the last element intact. + +**Example input** +1 2 3 4 5 + +**Example output** +2 1 4 3 5 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/111-Swap neighbors/app.py b/exercises/111-Swap neighbors/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/111-Swap neighbors/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/112-Maximum/README.md b/exercises/112-Maximum/README.md new file mode 100644 index 00000000..98f4f687 --- /dev/null +++ b/exercises/112-Maximum/README.md @@ -0,0 +1,18 @@ + # `112` Maximum + +## 📝 Instructions: + +Given a list of integers, find the first maximum element in it. Print its value and its index (counting with 0). + +**Example input** +1 2 3 2 1 + +**Example output** +3 2 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/112-Maximum/app.py b/exercises/112-Maximum/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/112-Maximum/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/113-Swap min and max/README.md b/exercises/113-Swap min and max/README.md new file mode 100644 index 00000000..1ad7fac2 --- /dev/null +++ b/exercises/113-Swap min and max/README.md @@ -0,0 +1,18 @@ + # `113` Swap min and max + +## 📝 Instructions: + +Given a list of distinct numbers, swap the minimum and the maximum and print the resulting list. + +**Example input** +3 4 5 2 1 + +**aExample output** +3 4 1 2 5 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/113-Swap min and max/app.py b/exercises/113-Swap min and max/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/113-Swap min and max/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/114-Pairs of equal numbers/README.md b/exercises/114-Pairs of equal numbers/README.md new file mode 100644 index 00000000..fd0f8bd7 --- /dev/null +++ b/exercises/114-Pairs of equal numbers/README.md @@ -0,0 +1,24 @@ + # `114` Pairs of equal numbers + +## 📝 Instructions: + +Given a list of numbers, count a number of pairs of equal elements. Any two elements that are equal to each other should be counted exactly once. + +**Example input #1** +1 2 3 2 3 + +**Example output #1** +2 + +**Example input #2** +1 1 1 1 1 + +**Example output #2** +10 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/114-Pairs of equal numbers/app.py b/exercises/114-Pairs of equal numbers/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/114-Pairs of equal numbers/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/115-Unique elements/README.md b/exercises/115-Unique elements/README.md new file mode 100644 index 00000000..6365e2cb --- /dev/null +++ b/exercises/115-Unique elements/README.md @@ -0,0 +1,18 @@ + # `115` Unique elements + +## 📝 Instructions: + +Given a list of numbers, find and print the elements that appear in it only once. Such elements should be printed in the order in which they occur in the original list. + +**Example input** +4 3 5 2 5 1 3 5 + +**Example output** +4 2 1 + +Theory +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/115-Unique elements/app.py b/exercises/115-Unique elements/app.py new file mode 100644 index 00000000..d3cf4f97 --- /dev/null +++ b/exercises/115-Unique elements/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/116-Eight queens/Eight queen.jpg b/exercises/116-Eight queens/Eight queen.jpg new file mode 100644 index 00000000..faf68fa0 Binary files /dev/null and b/exercises/116-Eight queens/Eight queen.jpg differ diff --git a/exercises/116-Eight queens/README.md b/exercises/116-Eight queens/README.md new file mode 100644 index 00000000..826c09c4 --- /dev/null +++ b/exercises/116-Eight queens/README.md @@ -0,0 +1,31 @@ + # `116` Eight queens + +## 📝 Instructions: + +It is possible to place 8 queens on an 8×8 chessboard so that no two queens threaten each other. Thus, it requires that no two queens share the same row, column, or diagonal. + +Given a placement of 8 queens on the chessboard. If there is a pair of queens that violates this rule, print YES, otherwise print NO. The input consists of eight coordinate pairs, one pair per line, with each pair giving the position of a queen on a standard chessboard with rows and columns numbered from 1 to 8. + +Image + + +**Example input** +1 5 +2 3 +3 1 +4 7 +5 2 +6 8 +7 6 +8 4 +(shown on the picture) + +**Example output** +NO + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/116-Eight queens/app.py b/exercises/116-Eight queens/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/116-Eight queens/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/117-Bowling/README.md b/exercises/117-Bowling/README.md new file mode 100644 index 00000000..136e5348 --- /dev/null +++ b/exercises/117-Bowling/README.md @@ -0,0 +1,23 @@ + # `117` Bowling + +## 📝 Instructions: + +In bowling, the player starts with 10 pins in a row at the far end of a lane. The goal is to knock all the pins down. For this assignment, the number of pins and balls will vary. Given the number of pins N and then the number of balls K to be rolled, followed by K pairs of numbers (one for each ball rolled), determine which pins remain standing after all the balls have been rolled. + +The balls are numbered from 1 to N for this situation. The subsequent number pairs, one for each K represent the first and last (inclusive) positions of the pins that were knocked down with each roll. Print a sequence of N characters, where "I" represents a pin left standing and "." represents a pin knocked down. + +**Example input** +10 3 +8 10 +2 5 +3 6 + +**Example output** +I.....I... + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/lists/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/lists/steps/1/ \ No newline at end of file diff --git a/exercises/117-Bowling/app.py b/exercises/117-Bowling/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/117-Bowling/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/118-Scale/README.md b/exercises/118-Scale/README.md new file mode 100644 index 00000000..0d0d2c62 --- /dev/null +++ b/exercises/118-Scale/README.md @@ -0,0 +1,24 @@ + # `118` Scale + +## 📝 Instructions: + +Given two integers - the number of rows m and columns n of m×n 2d list - and subsequent m rows of n integers, followed by one integer c. Multiply every element by c and print the result. + +**Example input** +3 4 +11 12 13 14 +21 22 23 24 +31 32 33 34 +2 + +**Example output** +22 24 26 28 +42 44 46 48 +62 64 66 68 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/two_dimensional_lists_arrays/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/two_dimensional_lists_arrays/steps/1/ \ No newline at end of file diff --git a/exercises/118-Scale/app.py b/exercises/118-Scale/app.py new file mode 100644 index 00000000..bae8ff65 --- /dev/null +++ b/exercises/118-Scale/app.py @@ -0,0 +1,4 @@ +# Read a 2D list of integers: +# a = [[int(j) for j in input().split()] for i in range(NUM_ROWS)] +# Print a value: +# print(a) diff --git a/exercises/119-lists_Maximum/README.md b/exercises/119-lists_Maximum/README.md new file mode 100644 index 00000000..489f029c --- /dev/null +++ b/exercises/119-lists_Maximum/README.md @@ -0,0 +1,22 @@ + # `119` lists: Maximum + +## 📝 Instructions: + +Given two integers - the number of rows m and columns n of m×n 2d list - and subsequent m rows of n integers, find the maximal element and print its row number and column number. If there are many maximal elements in different rows, report the one with smaller row number. If there are many maximal elements in the same row, report the one with smaller column number. + +**Example input** +3 4 +0 3 2 4 +2 3 5 5 +5 1 2 3 +(maximal element is highlighted) + +**Example output** +1 2 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/two_dimensional_lists_arrays/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/two_dimensional_lists_arrays/steps/1/ \ No newline at end of file diff --git a/exercises/119-lists_Maximum/app.py b/exercises/119-lists_Maximum/app.py new file mode 100644 index 00000000..bae8ff65 --- /dev/null +++ b/exercises/119-lists_Maximum/app.py @@ -0,0 +1,4 @@ +# Read a 2D list of integers: +# a = [[int(j) for j in input().split()] for i in range(NUM_ROWS)] +# Print a value: +# print(a) diff --git a/exercises/120-Diagonals/README.md b/exercises/120-Diagonals/README.md new file mode 100644 index 00000000..0734b6e7 --- /dev/null +++ b/exercises/120-Diagonals/README.md @@ -0,0 +1,27 @@ + # `120` Diagonals + +## 📝 Instructions: + +Given an integer n, create a two-dimensional array of size n×n according to the following rules and print it: + +On the main diagonal put 0. +On the diagonals adjacent to the main put 1. +On the next adjacent diagonals put 2, and so forth. + +**Example input** +5 + + +**Example output** +0 1 2 3 4 +1 0 1 2 3 +2 1 0 1 2 +3 2 1 0 1 +4 3 2 1 0 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/two_dimensional_lists_arrays/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/two_dimensional_lists_arrays/steps/1/ \ No newline at end of file diff --git a/exercises/120-Diagonals/app.py b/exercises/120-Diagonals/app.py new file mode 100644 index 00000000..be75a369 --- /dev/null +++ b/exercises/120-Diagonals/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) \ No newline at end of file diff --git a/exercises/121-Triangles/README.md b/exercises/121-Triangles/README.md new file mode 100644 index 00000000..68e35872 --- /dev/null +++ b/exercises/121-Triangles/README.md @@ -0,0 +1,25 @@ + # `121` Triangles + +## 📝 Instructions: + +Given an integer n, create a two-dimensional array of size n×n according to the following rules and print it: + +On the antidiagonal put 1. +On the diagonals above it put 0. +On the diagonals below it put 2. + +**Example input** +4 + +**Example output** +0 0 0 1 +0 0 1 2 +0 1 2 2 +1 2 2 2 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/two_dimensional_lists_arrays/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/two_dimensional_lists_arrays/steps/1/ \ No newline at end of file diff --git a/exercises/121-Triangles/app.py b/exercises/121-Triangles/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/121-Triangles/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/122-Swap columns/README.md b/exercises/122-Swap columns/README.md new file mode 100644 index 00000000..48cf8b2c --- /dev/null +++ b/exercises/122-Swap columns/README.md @@ -0,0 +1,24 @@ + # `122` Swap columns + +## 📝 Instructions: + +Given two integers - the number of rows m and columns n of m×n 2d list - and subsequent m rows of n integers, followed by two non-negative integers i and j less than n, swap the columns i and j of 2d list and print the result. + +**Example input** +3 4 +11 12 13 14 +21 22 23 24 +31 32 33 34 +0 1 + +**Example output** +12 11 13 14 +22 21 23 24 +32 31 33 34 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/two_dimensional_lists_arrays/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/two_dimensional_lists_arrays/steps/1/ \ No newline at end of file diff --git a/exercises/122-Swap columns/app.py b/exercises/122-Swap columns/app.py new file mode 100644 index 00000000..bae8ff65 --- /dev/null +++ b/exercises/122-Swap columns/app.py @@ -0,0 +1,4 @@ +# Read a 2D list of integers: +# a = [[int(j) for j in input().split()] for i in range(NUM_ROWS)] +# Print a value: +# print(a) diff --git a/exercises/123-Snowflake/README.md b/exercises/123-Snowflake/README.md new file mode 100644 index 00000000..b92a53a3 --- /dev/null +++ b/exercises/123-Snowflake/README.md @@ -0,0 +1,24 @@ + # `123` Snowflake + +## 📝 Instructions: + +Given an odd positive integer n, produce a two-dimensional array of size n×n. Fill each element with the character "." . Then fill the middle row, the middle column and the diagonals with the character "*". You'll get an image of a snow flake. Print the snow flake in n×n rows and columns and separate the characters with a single space. + +**Example input** +7 + +**Example output** +* . . * . . * +. * . * . * . +. . * * * . . +* * * * * * * +. . * * * . . +. * . * . * . +* . . * . . * + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/two_dimensional_lists_arrays/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/two_dimensional_lists_arrays/steps/1/ \ No newline at end of file diff --git a/exercises/123-Snowflake/app.py b/exercises/123-Snowflake/app.py new file mode 100644 index 00000000..710c4406 --- /dev/null +++ b/exercises/123-Snowflake/app.py @@ -0,0 +1,4 @@ +# Read an integer: +# a = int(input()) +# Print a value: +# print(a) diff --git a/exercises/124-Chessboard/README.md b/exercises/124-Chessboard/README.md new file mode 100644 index 00000000..769ac305 --- /dev/null +++ b/exercises/124-Chessboard/README.md @@ -0,0 +1,23 @@ + # `124` Chessboard + +## 📝 Instructions: + +Given two positive integers n and m, create a two-dimensional array of size n×m and populate it with the characters "."and "*" in a chequered pattern. The top left corner should have the character "." . + +**Example input** +6 8 + +**Example output** +. * . * . * . * +* . * . * . * . +. * . * . * . * +* . * . * . * . +. * . * . * . * +* . * . * . * . + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/two_dimensional_lists_arrays/ + +You may also try step-by-step theory chunks: +https://snakify.org/lessons/two_dimensional_lists_arrays/steps/1/ \ No newline at end of file diff --git a/exercises/124-Chessboard/app.py b/exercises/124-Chessboard/app.py new file mode 100644 index 00000000..7bbd8710 --- /dev/null +++ b/exercises/124-Chessboard/app.py @@ -0,0 +1,4 @@ +# Read a list of integers: +# a = [int(s) for s in input().split()] +# Print a value: +# print(a) diff --git a/exercises/125-Number of distinct/README.md b/exercises/125-Number of distinct/README.md new file mode 100644 index 00000000..d128db81 --- /dev/null +++ b/exercises/125-Number of distinct/README.md @@ -0,0 +1,15 @@ + # `125` Number of distinct + +## 📝 Instructions: + +Given a list of integers, count how many distinct numbers it has. This task can be solved in a single line. + +**Example input** +1 2 3 2 1 + +**Example output** +3 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/sets/ \ No newline at end of file diff --git a/exercises/125-Number of distinct/app.py b/exercises/125-Number of distinct/app.py new file mode 100644 index 00000000..9e046f0e --- /dev/null +++ b/exercises/125-Number of distinct/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) diff --git a/exercises/126-Number of common/README.md b/exercises/126-Number of common/README.md new file mode 100644 index 00000000..3f422188 --- /dev/null +++ b/exercises/126-Number of common/README.md @@ -0,0 +1,16 @@ + # `126` Number of common + +## 📝 Instructions: + +Given two lists of numbers, count how many numbers of the first one occur in the second one. + +**Example input** +1 3 2 +4 3 2 + +**Example output** +2 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/sets/ \ No newline at end of file diff --git a/exercises/126-Number of common/app.py b/exercises/126-Number of common/app.py new file mode 100644 index 00000000..12a4dcdc --- /dev/null +++ b/exercises/126-Number of common/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) \ No newline at end of file diff --git a/exercises/127-Intersection/README.md b/exercises/127-Intersection/README.md new file mode 100644 index 00000000..03ff892b --- /dev/null +++ b/exercises/127-Intersection/README.md @@ -0,0 +1,16 @@ + # `127` Intersection + +## 📝 Instructions: + +Given two lists of numbers, find all the numbers that occur in both the first and the second list. Print them in ascending order. + +**Example input** +1 3 2 +4 3 2 + +**Example output** +2 3 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/sets/ \ No newline at end of file diff --git a/exercises/127-Intersection/app.py b/exercises/127-Intersection/app.py new file mode 100644 index 00000000..9e046f0e --- /dev/null +++ b/exercises/127-Intersection/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) diff --git a/exercises/128-Seen before/README.md b/exercises/128-Seen before/README.md new file mode 100644 index 00000000..37b46963 --- /dev/null +++ b/exercises/128-Seen before/README.md @@ -0,0 +1,20 @@ + # `128` Seen before + +## 📝 Instructions: + +Given a sequence of numbers, scan them from left to right and for each number print YES if this number was already seen or NO if it appears for the first time. + +**Example input** +1 2 3 2 3 4 + +**Example output** +NO +NO +NO +YES +YES +NO + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/sets/ \ No newline at end of file diff --git a/exercises/128-Seen before/app.py b/exercises/128-Seen before/app.py new file mode 100644 index 00000000..9e046f0e --- /dev/null +++ b/exercises/128-Seen before/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) diff --git a/exercises/129-Guess the number/README.md b/exercises/129-Guess the number/README.md new file mode 100644 index 00000000..2b15491c --- /dev/null +++ b/exercises/129-Guess the number/README.md @@ -0,0 +1,22 @@ + # `129` Guess the number + +## 📝 Instructions: + +Augustus and Beatrice play the following game. Augustus thinks of a secret integer number from 1 to n. Beatrice tries to guess the number by providing a set of integers. Augustus answers YES if his secret number exists in the provided set, or NO, if his number does not exist in the provided set. Then after a few questions Beatrice, totally confused, asks you to help her determine Augustus's secret number. + +Given the positive integer n in the first line, followed by the a sequence Beatrice's guesses, series of numbers seperated by spaces and Agustus's responses, or Beatrice's plea for HELP. When Beatrice calls for help, provide a list of all the remaining possible secret numbers, in ascending order, separated by a space. + +**Example input** +10 +1 2 3 4 5 +YES +2 4 6 8 10 +NO +HELP + +**Example output** +1 3 5 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/sets/ \ No newline at end of file diff --git a/exercises/129-Guess the number/app.py b/exercises/129-Guess the number/app.py new file mode 100644 index 00000000..9e046f0e --- /dev/null +++ b/exercises/129-Guess the number/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) diff --git a/exercises/130-Number of occurrences/README.md b/exercises/130-Number of occurrences/README.md new file mode 100644 index 00000000..a8064157 --- /dev/null +++ b/exercises/130-Number of occurrences/README.md @@ -0,0 +1,15 @@ + # `130` Number of occurrences + +## 📝 Instructions: + +The text is given in a single line. For each word of the text count the number of its occurrences before it. + +**Example input** +one two one two three two four three + +**Example output** +0 0 1 1 0 2 0 1 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/dictionaries_dicts/ \ No newline at end of file diff --git a/exercises/130-Number of occurrences/app.py b/exercises/130-Number of occurrences/app.py new file mode 100644 index 00000000..12a4dcdc --- /dev/null +++ b/exercises/130-Number of occurrences/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) \ No newline at end of file diff --git a/exercises/131-Synonyms/README.md b/exercises/131-Synonyms/README.md new file mode 100644 index 00000000..a359c5c8 --- /dev/null +++ b/exercises/131-Synonyms/README.md @@ -0,0 +1,21 @@ + # `131` Synonyms + +## 📝 Instructions: + +You are given a dictionary consisting of word pairs. Every word is a synonym of the other word in its pair. All the words in the dictionary are different. + +After the dictionary there's one more word given. Find a synonym for it. + +**Example input** +3 +Hello Hi +Bye Goodbye +List Array +Goodbye + +**Example output** +Bye + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/dictionaries_dicts/ \ No newline at end of file diff --git a/exercises/131-Synonyms/app.py b/exercises/131-Synonyms/app.py new file mode 100644 index 00000000..12a4dcdc --- /dev/null +++ b/exercises/131-Synonyms/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) \ No newline at end of file diff --git a/exercises/132-Elections/README.md b/exercises/132-Elections/README.md new file mode 100644 index 00000000..75e53c99 --- /dev/null +++ b/exercises/132-Elections/README.md @@ -0,0 +1,21 @@ + # `132` Elections + +## 📝 Instructions: + +The first line contains the number of records. After that, each entry contains the name of the candidate and the number of votes they got in some state. Count the results of the elections: sum the number of votes for each candidate. Print candidates in the alphabetical order. + +**Example input** +5 +McCain 10 +McCain 5 +Obama 9 +Obama 8 +McCain 1 + +**Example output** +McCain 16 +Obama 17 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/dictionaries_dicts/ \ No newline at end of file diff --git a/exercises/132-Elections/app.py b/exercises/132-Elections/app.py new file mode 100644 index 00000000..9e046f0e --- /dev/null +++ b/exercises/132-Elections/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) diff --git a/exercises/133-Most frequent word/README.md b/exercises/133-Most frequent word/README.md new file mode 100644 index 00000000..d2e1b122 --- /dev/null +++ b/exercises/133-Most frequent word/README.md @@ -0,0 +1,17 @@ + # `133` Most frequent word + +## 📝 Instructions: + +Given the text: the first line contains the number of lines, then given the lines of words. Print the word in the text that occurs most often. If there are many such words, print the one that is less in the alphabetical order. + +**Example input** +2 +apple orange banana +banana orange + +**Example output** +banana + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/dictionaries_dicts/ \ No newline at end of file diff --git a/exercises/133-Most frequent word/app.py b/exercises/133-Most frequent word/app.py new file mode 100644 index 00000000..12a4dcdc --- /dev/null +++ b/exercises/133-Most frequent word/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) \ No newline at end of file diff --git a/exercises/134-Access rights/README.md b/exercises/134-Access rights/README.md new file mode 100644 index 00000000..20f2e90e --- /dev/null +++ b/exercises/134-Access rights/README.md @@ -0,0 +1,37 @@ + # `134` Access rights + +## 📝 Instructions: + +The virus attacked the filesystem of the supercomputer and broke the control of access rights to the files. For each file there is a known set of operations which may be applied to it: + +write W, +read R, +execute X. + +The first line contains the number N — the number of files contained in the filesystem. The following N lines contain the file names and allowed operations with them, separated by spaces. The next line contains an integer M — the number of operations to the files. In the last M lines specify the operations that are requested for files. One file can be requested many times. + +You need to recover the control over the access rights to the files. For each request your program should return OK if the requested operation is valid or Access denied if the operation is invalid. + +**Example input** +4 +helloworld.exe R X +pinglog W R +nya R +goodluck X W R +5 +read nya +write helloworld.exe +execute nya +read pinglog +write pinglog + +**Example output** +OK +Access denied +Access denied +OK +OK + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/dictionaries_dicts/ \ No newline at end of file diff --git a/exercises/134-Access rights/app.py b/exercises/134-Access rights/app.py new file mode 100644 index 00000000..12a4dcdc --- /dev/null +++ b/exercises/134-Access rights/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) \ No newline at end of file diff --git a/exercises/135-Countries and cities/README.md b/exercises/135-Countries and cities/README.md new file mode 100644 index 00000000..79799c25 --- /dev/null +++ b/exercises/135-Countries and cities/README.md @@ -0,0 +1,23 @@ + # `135` Countries and cities + +## 📝 Instructions: + +Given a list of countries and cities of each country, then given the names of the cities. For each city print the country in which it is located. + +**Example input** +2 +USA Boston Pittsburgh Washington Seattle +UK London Edinburgh Cardiff Belfast +3 +Cardiff +Seattle +London + +**Example output** +UK +USA +UK + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/dictionaries_dicts/ \ No newline at end of file diff --git a/exercises/135-Countries and cities/app.py b/exercises/135-Countries and cities/app.py new file mode 100644 index 00000000..9e046f0e --- /dev/null +++ b/exercises/135-Countries and cities/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) diff --git a/exercises/136-Frequency analysis/README.md b/exercises/136-Frequency analysis/README.md new file mode 100644 index 00000000..b1d464e8 --- /dev/null +++ b/exercises/136-Frequency analysis/README.md @@ -0,0 +1,37 @@ + # `136` Frequency analysis + +## 📝 Instructions: + +Given a number n, followed by n lines of text, print all words encountered in the text, one per line, with their number of occurrences in the text. The words should be sorted in descending order according to their number of occurrences, and all words within the same frequency should be printed in lexicographical order. + +Hint. After you created a dictionary of the words and their frequencies, you would like to sort it according to the frequencies. This can be achieved if you create a list whose elements are lists of two elements: the number of occurrences of a word and the word itself. For example, [[2, 'hi'], [1, 'what'], [3, 'is']]. Then the standard list sort will sort a list of lists, with the lists compared by the first element, and if these are equal, by the second element. This is nearly what is required. + +**Example input** +9 +hi +hi +what is your name +my name is bond +james bond +my name is damme +van damme +claude van damme +jean claude van damme + +**Example output** +damme 4 +is 3 +name 3 +van 3 +bond 2 +claude 2 +hi 2 +my 2 +james 1 +jean 1 +what 1 +your 1 + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/dictionaries_dicts/ \ No newline at end of file diff --git a/exercises/136-Frequency analysis/app.py b/exercises/136-Frequency analysis/app.py new file mode 100644 index 00000000..12a4dcdc --- /dev/null +++ b/exercises/136-Frequency analysis/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) \ No newline at end of file diff --git a/exercises/137-English-Latin dictionary/README.md b/exercises/137-English-Latin dictionary/README.md new file mode 100644 index 00000000..0b0cfbd3 --- /dev/null +++ b/exercises/137-English-Latin dictionary/README.md @@ -0,0 +1,35 @@ + # `137` English-Latin dictionary + +## 📝 Instructions: + +One day, going through old books in the attic, a student Bob found an English-Latin dictionary. By that time he spoke English fluently, and his dream was to learn Latin. So finding the dictionary was just in time. + +Unfortunately, full-fledged language studying process requires also another type of dictionary: Latin-English. For lack of a better way he decided to make a second dictionary using the first one. + +As you know, the dictionary consists of words, each of which contains multiple translations. For each Latin word that appears anywhere in the dictionary, Bob has to find all its translations (that is, all English words, for which our Latin word is among its translations), and take them and only them as the translations of this Latin word. + +Help him to create a Latin-English. + +The first line contains a single integer N — the number of English words in the dictionary - followed by N dictionary entries. Each entry is contained on a separate line, which contains first the English word, then a hyphen surrounded by spaces and then comma-separated list with the translations of this English word in Latin. All the words consist only of lowercase English letters. The translations are sorted in lexicographical order. The order of English words in the dictionary is also lexicographic. + +Print the corresponding Latin-English dictionary in the same format. In particular, the first word line should be the lexicographically minimal translation of the Latin word, then second in that order, etc. The English words inside each line should also be sorted lexicographically. + +**Example input** +3 +apple - malum, pomum, popula +fruit - baca, bacca, popum +punishment - malum, multa + +**Example output** +7 +baca - fruit +bacca - fruit +malum - apple, punishment +multa - punishment +pomum - apple +popula - apple +popum - fruit + +**Theory** +If you don't know how to start solving this assignment, please, review a theory for this lesson: +https://snakify.org/lessons/dictionaries_dicts/ \ No newline at end of file diff --git a/exercises/137-English-Latin dictionary/app.py b/exercises/137-English-Latin dictionary/app.py new file mode 100644 index 00000000..9e046f0e --- /dev/null +++ b/exercises/137-English-Latin dictionary/app.py @@ -0,0 +1,4 @@ +# Read a string: +# s = input() +# Print a value: +# print(s) diff --git a/learn.json b/learn.json deleted file mode 100644 index 31b7c454..00000000 --- a/learn.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "language": "python3", - "title": "Master Python by practice (interactive)", - "repository": "https://github.com/4GeeksAcademy/master-python-programming-exercises", - "preview": "https://github.com/4GeeksAcademy/master-python-programming-exercises/blob/master/preview.gif?raw=true", - "description": "Practice your Python programming skills with this interactive and auto-graded set of exercises.", - "duration": 10, - "difficulty": "easy", - "video-solutions": false, - "graded": true -}