├── src ├── hexlet │ ├── __init__.py │ └── test.py └── setup │ └── __init__.py ├── modules ├── 10-basics │ ├── 40-testing │ │ ├── index.py │ │ ├── Makefile │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── test_code.py │ │ └── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 20-comments │ │ ├── Makefile │ │ ├── index.py │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── test_code.py │ ├── 10-hello-world │ │ ├── Makefile │ │ ├── index.py │ │ ├── en │ │ │ ├── data.yml │ │ │ ├── EXERCISE.md │ │ │ └── README.md │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── hello-world.png │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── test_code.py │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 30-instructions │ │ ├── Makefile │ │ ├── index.py │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── instructions.png │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── test_code.py │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ └── 50-syntax-errors │ │ ├── Makefile │ │ ├── index.py │ │ ├── test_code.py │ │ ├── en │ │ ├── EXERCISE.md │ │ └── data.yml │ │ ├── es │ │ ├── EXERCISE.md │ │ └── data.yml │ │ └── ru │ │ ├── EXERCISE.md │ │ └── data.yml ├── 20-arithmetics │ ├── 20-basic │ │ ├── index.py │ │ ├── Makefile │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── assets │ │ │ │ └── arithmetics.png │ │ ├── es │ │ │ └── EXERCISE.md │ │ └── test_code.py │ ├── 25-operator │ │ ├── index.py │ │ ├── Makefile │ │ ├── es │ │ │ └── EXERCISE.md │ │ ├── en │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ └── EXERCISE.md │ │ └── test_code.py │ ├── 43-float │ │ ├── index.py │ │ ├── Makefile │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── test_code.py │ ├── 40-priority │ │ ├── Makefile │ │ ├── index.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── ru │ │ │ └── data.yml │ ├── 45-linting │ │ ├── Makefile │ │ ├── index.py │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ ├── assets │ │ │ │ └── errors-python.png │ │ │ └── data.yml │ │ ├── test_code.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 27-commutativity │ │ ├── Makefile │ │ ├── index.py │ │ ├── test_code.py │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 30-composition │ │ ├── Makefile │ │ ├── index.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── test_code.py │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── description.ru.yml │ └── description.en.yml ├── 50-loops │ ├── 70-for │ │ ├── Makefile │ │ ├── en │ │ │ └── data.yml │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── es │ │ │ └── data.yml │ │ ├── index.py │ │ └── test_code.py │ ├── 10-while │ │ ├── Makefile │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── while.png │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── test_code.py │ ├── 80-for-in-range │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ └── data.yml │ │ ├── test_code.py │ │ └── index.py │ ├── 20-aggregation-numbers │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── iterations.png │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── test_code.py │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 23-aggregation-strings │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── test_code.py │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 30-syntactic-sugar │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ ├── index.py │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 55-return-from-loops │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── test_code.py │ ├── 25-iteration-over-string │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ └── index.py │ └── 26-conditions-inside-loops │ │ ├── Makefile │ │ ├── ru │ │ ├── data.yml │ │ ├── assets │ │ │ ├── edge-cases.png │ │ │ └── conditions-inside-loops.png │ │ └── EXERCISE.md │ │ ├── es │ │ ├── data.yml │ │ └── EXERCISE.md │ │ ├── en │ │ ├── data.yml │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ └── index.py ├── 25-strings │ ├── 10-quotes │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── strings.png │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── test_code.py │ ├── 30-encoding │ │ ├── Makefile │ │ ├── index.py │ │ ├── test_code.py │ │ ├── en │ │ │ └── data.yml │ │ ├── es │ │ │ └── data.yml │ │ └── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 15-escape-characters │ │ ├── Makefile │ │ ├── index.py │ │ ├── test_code.py │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 20-string-concatenation │ │ ├── Makefile │ │ ├── index.py │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── test_code.py │ ├── description.en.yml │ ├── description.ru.yml │ └── description.es.yml ├── 45-logic │ ├── 10-bool-type │ │ ├── Makefile │ │ ├── index.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 15-bool-strings │ │ ├── Makefile │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ └── test_code.py │ ├── 25-logical-operators │ │ ├── Makefile │ │ ├── index.py │ │ ├── assets │ │ │ └── lannisters.jpg │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── even-or-odd.jpg │ │ │ └── data.yml │ │ ├── test_code.py │ │ └── en │ │ │ └── data.yml │ ├── 28-logical-negation │ │ ├── Makefile │ │ ├── en │ │ │ └── data.yml │ │ ├── index.py │ │ ├── es │ │ │ └── data.yml │ │ ├── ru │ │ │ └── data.yml │ │ └── test_code.py │ ├── 90-logical-expressions │ │ ├── Makefile │ │ ├── en │ │ │ └── data.yml │ │ ├── ru │ │ │ └── data.yml │ │ ├── index.py │ │ ├── es │ │ │ └── data.yml │ │ └── test_code.py │ ├── 20-logic-combine-expressions │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── test_code.py │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── description.en.yml │ ├── description.ru.yml │ └── description.es.yml ├── 48-conditionals │ ├── 30-if │ │ ├── Makefile │ │ ├── index.py │ │ ├── ru │ │ │ ├── assets │ │ │ │ ├── ternary.png │ │ │ │ └── if-statement.png │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 40-if-else │ │ ├── Makefile │ │ ├── en │ │ │ └── data.yml │ │ ├── ru │ │ │ └── data.yml │ │ ├── es │ │ │ └── data.yml │ │ └── index.py │ ├── 50-else-if │ │ ├── Makefile │ │ ├── ru │ │ │ └── data.yml │ │ ├── en │ │ │ └── data.yml │ │ ├── es │ │ │ └── data.yml │ │ ├── index.py │ │ └── test_code.py │ ├── 65-match │ │ ├── Makefile │ │ ├── en │ │ │ └── data.yml │ │ ├── es │ │ │ └── data.yml │ │ ├── ru │ │ │ └── data.yml │ │ ├── test_code.py │ │ └── index.py │ ├── 60-ternary-operator │ │ ├── Makefile │ │ ├── index.py │ │ ├── ru │ │ │ ├── assets │ │ │ │ ├── ternary.png │ │ │ │ └── if-statement.png │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── description.ru.yml │ ├── description.en.yml │ └── description.es.yml ├── 30-variables │ ├── 10-definition │ │ ├── Makefile │ │ ├── index.py │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ ├── assets │ │ │ │ └── variable-definition.png │ │ │ └── data.yml │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── test_code.py │ ├── 12-change │ │ ├── Makefile │ │ ├── index.py │ │ ├── test_code.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 23-constants │ │ ├── Makefile │ │ ├── index.py │ │ ├── test_code.py │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ ├── data.yml │ │ │ └── README.md │ │ └── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 19-naming-style │ │ ├── Makefile │ │ ├── index.py │ │ ├── test_code.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 20-magic-numbers │ │ ├── Makefile │ │ ├── en │ │ │ └── data.yml │ │ ├── es │ │ │ └── data.yml │ │ ├── ru │ │ │ └── data.yml │ │ ├── test_code.py │ │ └── index.py │ ├── 13-variables-naming │ │ ├── Makefile │ │ ├── index.py │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── naming.png │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 15-variables-expressions │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ ├── index.py │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 18-variable-concatenation │ │ ├── Makefile │ │ ├── test_code.py │ │ ├── index.py │ │ └── en │ │ │ └── data.yml │ ├── description.en.yml │ ├── description.ru.yml │ └── description.es.yml ├── 38-objects │ ├── 100-objects │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── upper.png │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── index.py │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── test_code.py │ ├── 500-method-chain │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── test_code.py │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── methods-chain.png │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 200-methods-immutability │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── test_code.py │ │ ├── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ └── description.ru.yml ├── 31-advanced-strings │ ├── 30-symbols │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ ├── assets │ │ │ │ └── symbols.png │ │ │ └── data.yml │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── test_code.py │ ├── 70-slices │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── test_code.py │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 25-interpolation │ │ ├── Makefile │ │ ├── index.py │ │ ├── .DS_Store │ │ ├── test_code.py │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 90-multiline-strings │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── .DS_Store │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ └── test_code.py │ ├── description.ru.yml │ ├── description.en.yml │ └── description.es.yml ├── 33-data-types │ ├── 40-primitive-data-types │ │ ├── index.py │ │ ├── Makefile │ │ ├── en │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ └── EXERCISE.md │ │ ├── es │ │ │ └── EXERCISE.md │ │ └── test_code.py │ ├── 50-strong-typing │ │ ├── Makefile │ │ ├── index.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ └── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 55-data-types-casting │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── ru │ │ │ ├── data.yml │ │ │ ├── assets │ │ │ │ └── number-as-string.png │ │ │ └── EXERCISE.md │ │ └── test_code.py │ ├── 52-data-types-immutability │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── index.py │ │ ├── test_code.py │ │ ├── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── es │ │ │ └── data.yml │ ├── description.en.yml │ ├── description.ru.yml │ └── description.es.yml ├── 35-calling-functions │ ├── 100-call │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── function.png │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── test_code.py │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── index.py │ ├── 270-deterministic │ │ ├── Makefile │ │ ├── en │ │ │ └── data.yml │ │ ├── index.py │ │ ├── ru │ │ │ ├── assets │ │ │ │ └── deterministic.png │ │ │ └── data.yml │ │ ├── test_code.py │ │ └── es │ │ │ └── data.yml │ ├── 180-variadic-parameters │ │ ├── Makefile │ │ ├── index.py │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ ├── ru │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ ├── 150-calling-functions-expression │ │ ├── Makefile │ │ ├── en │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ ├── test_code.py │ │ ├── index.py │ │ ├── es │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ │ └── ru │ │ │ ├── data.yml │ │ │ └── EXERCISE.md │ ├── 135-calling-functions-default-params │ │ ├── Makefile │ │ ├── ru │ │ │ ├── data.yml │ │ │ ├── EXERCISE.md │ │ │ └── assets │ │ │ │ └── default-parameters.png │ │ ├── index.py │ │ ├── es │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ ├── en │ │ │ ├── EXERCISE.md │ │ │ └── data.yml │ │ └── test_code.py │ └── description.ru.yml └── 40-define-functions │ ├── 200-return │ ├── Makefile │ ├── en │ │ ├── data.yml │ │ └── EXERCISE.md │ ├── index.py │ ├── ru │ │ ├── data.yml │ │ └── assets │ │ │ └── sum-python.jpg │ ├── es │ │ ├── data.yml │ │ └── EXERCISE.md │ └── test_code.py │ ├── 100-define-function │ ├── Makefile │ ├── index.py │ ├── es │ │ ├── data.yml │ │ └── EXERCISE.md │ ├── ru │ │ ├── assets │ │ │ └── define_python.png │ │ ├── data.yml │ │ └── EXERCISE.md │ ├── en │ │ ├── data.yml │ │ └── EXERCISE.md │ └── test_code.py │ ├── 500-named-arguments │ ├── Makefile │ ├── en │ │ └── data.yml │ ├── es │ │ └── data.yml │ ├── ru │ │ └── data.yml │ ├── index.py │ └── test_code.py │ ├── 600-type-annotations │ ├── Makefile │ ├── en │ │ ├── data.yml │ │ └── EXERCISE.md │ ├── ru │ │ └── data.yml │ ├── es │ │ ├── data.yml │ │ └── EXERCISE.md │ ├── index.py │ └── test_code.py │ ├── 400-default-parameters │ ├── Makefile │ ├── en │ │ └── data.yml │ ├── ru │ │ └── data.yml │ ├── index.py │ ├── test_code.py │ └── es │ │ └── data.yml │ └── test_code.py ├── bin └── test.sh ├── .gitignore ├── docker-compose.yml ├── .markdownlint.json ├── docker-compose.override.yml ├── .yamllint ├── pyproject.toml ├── spec.yml ├── .dockerignore └── .github └── workflows └── Docker.yml /src/hexlet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/10-basics/40-testing/index.py: -------------------------------------------------------------------------------- 1 | print(10) 2 | -------------------------------------------------------------------------------- /modules/20-arithmetics/20-basic/index.py: -------------------------------------------------------------------------------- 1 | print(81 / 9) 2 | -------------------------------------------------------------------------------- /modules/50-loops/70-for/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/10-basics/20-comments/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/10-basics/40-testing/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/10-basics/40-testing/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Display `10`. 2 | -------------------------------------------------------------------------------- /modules/20-arithmetics/25-operator/index.py: -------------------------------------------------------------------------------- 1 | print(6 - -81) 2 | -------------------------------------------------------------------------------- /modules/20-arithmetics/43-float/index.py: -------------------------------------------------------------------------------- 1 | print(0.39 * 0.22) 2 | -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/45-logic/10-bool-type/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/50-loops/10-while/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/index.py: -------------------------------------------------------------------------------- 1 | print("Hello, World!") 2 | -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/10-basics/50-syntax-errors/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/20-basic/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/25-operator/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/40-priority/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/25-strings/30-encoding/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/30-variables/10-definition/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/30-variables/12-change/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Objects 3 | -------------------------------------------------------------------------------- /modules/45-logic/15-bool-strings/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/48-conditionals/40-if-else/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/48-conditionals/50-else-if/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/48-conditionals/65-match/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/50-loops/80-for-in-range/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /bin/test.sh: -------------------------------------------------------------------------------- 1 | pytest -p setup --capture=no --color=yes -x --tb=short -q 2 | -------------------------------------------------------------------------------- /modules/10-basics/20-comments/index.py: -------------------------------------------------------------------------------- 1 | # You know nothing, Jon Snow! 2 | -------------------------------------------------------------------------------- /modules/20-arithmetics/27-commutativity/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/30-composition/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/43-float/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | 4 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/index.py: -------------------------------------------------------------------------------- 1 | print((5**2) - (3 * 7)) 2 | -------------------------------------------------------------------------------- /modules/25-strings/15-escape-characters/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/30-variables/19-naming-style/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/30-variables/20-magic-numbers/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/index.py: -------------------------------------------------------------------------------- 1 | DRAGONS_BORN_COUNT = 3 2 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/70-slices/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/33-data-types/40-primitive-data-types/index.py: -------------------------------------------------------------------------------- 1 | print(-0.304) 2 | -------------------------------------------------------------------------------- /modules/33-data-types/50-strong-typing/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/33-data-types/50-strong-typing/index.py: -------------------------------------------------------------------------------- 1 | print(7 - (-8 - -2)) 2 | -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/200-return/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/45-logic/25-logical-operators/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/45-logic/28-logical-negation/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/45-logic/90-logical-expressions/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/50-loops/23-aggregation-strings/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/50-loops/30-syntactic-sugar/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/50-loops/55-return-from-loops/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Hello, world! 3 | -------------------------------------------------------------------------------- /modules/10-basics/40-testing/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Muestra en la pantalla `10`. 2 | -------------------------------------------------------------------------------- /modules/20-arithmetics/40-priority/index.py: -------------------------------------------------------------------------------- 1 | print(70 * (3 + 4) / (8 + 2)) 2 | -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Quotes 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/25-strings/20-string-concatenation/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/30-variables/13-variables-naming/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/38-objects/200-methods-immutability/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/45-logic/15-bool-strings/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Сравнение строк 3 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/50-loops/25-iteration-over-string/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/50-loops/70-for/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Cycle For 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/10-basics/50-syntax-errors/index.py: -------------------------------------------------------------------------------- 1 | print("What Is Dead May Never Die") 2 | -------------------------------------------------------------------------------- /modules/20-arithmetics/27-commutativity/index.py: -------------------------------------------------------------------------------- 1 | print(3**5) 2 | print(-8 / -4) 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/30-composition/index.py: -------------------------------------------------------------------------------- 1 | print(((8 / 2) + 5) - (-3 / 2)) 2 | -------------------------------------------------------------------------------- /modules/30-variables/15-variables-expressions/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/30-variables/18-variable-concatenation/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/33-data-types/40-primitive-data-types/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/33-data-types/52-data-types-immutability/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/35-calling-functions/270-deterministic/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/200-return/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Return values 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/500-named-arguments/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/600-type-annotations/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/45-logic/20-logic-combine-expressions/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/40-priority/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Priority 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/35-calling-functions/180-variadic-parameters/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/400-default-parameters/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/70-slices/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Line slices 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/33-data-types/40-primitive-data-types/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Display the number `-0.304`. 2 | -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Functions 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: The call chain 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/40-define-functions/500-named-arguments/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Named arguments 3 | -------------------------------------------------------------------------------- /src/setup/__init__.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | pytest.register_assert_rewrite("hexlet") 4 | -------------------------------------------------------------------------------- /modules/20-arithmetics/20-basic/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Print the result of dividing `81` by `9`. 3 | -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/index.py: -------------------------------------------------------------------------------- 1 | print('"Khal Drogo\'s favorite word is "athjahakar""') 2 | -------------------------------------------------------------------------------- /modules/25-strings/30-encoding/index.py: -------------------------------------------------------------------------------- 1 | print(chr(126)) 2 | print(chr(94)) 3 | print(chr(37)) 4 | -------------------------------------------------------------------------------- /modules/30-variables/20-magic-numbers/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Magic numbers 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/33-data-types/40-primitive-data-types/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Выведите на экран число `-0.304`. 2 | -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Explicit type conversion 3 | -------------------------------------------------------------------------------- /modules/35-calling-functions/150-calling-functions-expression/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/500-named-arguments/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Argumentos Nombrados 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/600-type-annotations/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Type Annotations 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/600-type-annotations/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Аннотации типов 3 | -------------------------------------------------------------------------------- /modules/50-loops/30-syntactic-sugar/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Syntactic Sugar 3 | tips: [] 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.ru 2 | __pycache__ 3 | .mypy_cache 4 | .DS_Store 5 | .ropeproject 6 | text_length.txt 7 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | services: 3 | exercises: 4 | build: . 5 | command: make check 6 | -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/index.py: -------------------------------------------------------------------------------- 1 | print("Robert") 2 | print("Stannis") 3 | print("Renly") 4 | -------------------------------------------------------------------------------- /modules/30-variables/10-definition/index.py: -------------------------------------------------------------------------------- 1 | motto = "What Is Dead May Never Die!" 2 | print(motto) 3 | -------------------------------------------------------------------------------- /modules/30-variables/15-variables-expressions/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Expressions in definitions 3 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @ test.sh 3 | -------------------------------------------------------------------------------- /modules/38-objects/200-methods-immutability/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Immutability 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/40-define-functions/500-named-arguments/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Именованные аргументы 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/600-type-annotations/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Anotaciones de tipos 3 | -------------------------------------------------------------------------------- /modules/45-logic/10-bool-type/index.py: -------------------------------------------------------------------------------- 1 | def is_pensioner(age: int) -> bool: 2 | return age >= 60 3 | -------------------------------------------------------------------------------- /modules/45-logic/90-logical-expressions/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: The result of logical expressions 3 | -------------------------------------------------------------------------------- /modules/45-logic/90-logical-expressions/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Результат логических выражений 3 | -------------------------------------------------------------------------------- /modules/50-loops/25-iteration-over-string/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Traversing Strings 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/20-arithmetics/20-basic/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Выведите на экран результат деления числа `81` на `9`. 2 | -------------------------------------------------------------------------------- /modules/20-arithmetics/30-composition/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Composition of operations 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/33-data-types/40-primitive-data-types/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Imprime en pantalla el número `-0.304`. 2 | -------------------------------------------------------------------------------- /modules/33-data-types/50-strong-typing/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Strong (or Strict) Typing 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/10-basics/20-comments/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Создайте комментарий с текстом: `You know nothing, Jon Snow!` 2 | -------------------------------------------------------------------------------- /modules/30-variables/13-variables-naming/index.py: -------------------------------------------------------------------------------- 1 | my_brothers_count = 2 2 | 3 | print(my_brothers_count) 4 | -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/index.py: -------------------------------------------------------------------------------- 1 | def print_motto(): 2 | print("Winter is coming") 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/400-default-parameters/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Optional function parameters 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/400-default-parameters/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Необязательные параметры функций 3 | -------------------------------------------------------------------------------- /modules/45-logic/15-bool-strings/index.py: -------------------------------------------------------------------------------- 1 | def is_long_word(word: str) -> bool: 2 | return len(word) > 5 3 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Data Aggregation (Numbers) 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/50-loops/23-aggregation-strings/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Data Aggregation (Strings) 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Условия внутри тела цикла 3 | tips: [] 4 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD013": false, 3 | "MD033": false, 4 | "MD041": false, 5 | "MD040": false 6 | } 7 | -------------------------------------------------------------------------------- /docker-compose.override.yml: -------------------------------------------------------------------------------- 1 | --- 2 | services: 3 | exercises: 4 | volumes: 5 | - .:/exercises-python 6 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Extracting characters from a string 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/index.py: -------------------------------------------------------------------------------- 1 | name = "Na\nharis" 2 | 3 | # BEGIN 4 | print(name[7]) 5 | # END 6 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/70-slices/index.py: -------------------------------------------------------------------------------- 1 | value = "Hexlet" 2 | 3 | # BEGIN 4 | print(value[2:5]) 5 | # END 6 | -------------------------------------------------------------------------------- /modules/35-calling-functions/180-variadic-parameters/index.py: -------------------------------------------------------------------------------- 1 | # BEGIN 2 | print(min(3, -3, 10, 22, 0)) 3 | # END 4 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Condiciones dentro de un bucle 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/20-arithmetics/43-float/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Calculate and display the product of two numbers: *0.39* and *0.22* 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/43-float/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Вычислите и выведите на экран произведение двух чисел: _0.39_ и _0.22_ 2 | -------------------------------------------------------------------------------- /modules/35-calling-functions/150-calling-functions-expression/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Function call - expressions 3 | -------------------------------------------------------------------------------- /modules/45-logic/20-logic-combine-expressions/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Combining Operations and Functions 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/50-loops/80-for-in-range/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: For loop and range function 3 | tips: [] 4 | definitions: [] 5 | -------------------------------------------------------------------------------- /modules/50-loops/80-for-in-range/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Цикл for и функция range 3 | tips: [] 4 | definitions: [] 5 | -------------------------------------------------------------------------------- /modules/10-basics/20-comments/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Create a one-line comment with the text: `You know nothing, Jon Snow!` 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/20-basic/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Muestra en pantalla el resultado de dividir el número `81` entre `9`. 3 | -------------------------------------------------------------------------------- /modules/25-strings/15-escape-characters/index.py: -------------------------------------------------------------------------------- 1 | print('- Did Joffrey agree?\n- He did. He also said "I love using \\n".') 2 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Display the last character of the string in the `name` variable 3 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Conditions Inside the Body of the Loop 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/10-basics/20-comments/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Crea un comentario de una línea con el texto: `You know nothing, Jon Snow!` 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Напишите в редакторе `print( (5 **2)-(3* 7))`, расставив правильно пробелы 2 | -------------------------------------------------------------------------------- /modules/25-strings/20-string-concatenation/index.py: -------------------------------------------------------------------------------- 1 | print("Winter " + "came " + "for " + "the " + "House " + "of " + "Frey.") 2 | -------------------------------------------------------------------------------- /modules/30-variables/12-change/index.py: -------------------------------------------------------------------------------- 1 | name = "Brienna" 2 | 3 | # BEGIN 4 | name = "anneirB" 5 | # END 6 | 7 | print(name) 8 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Выведите на экран последний символ строки, находящейся в переменной `name` 2 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Multi-line strings 3 | definitions: [] 4 | tips: [] 5 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Параметры по умолчанию 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/30-variables/19-naming-style/index.py: -------------------------------------------------------------------------------- 1 | first_number = 20 2 | second_number = -100 3 | 4 | print(first_number * second_number) 5 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.DRAGONS_BORN_COUNT == 3 6 | -------------------------------------------------------------------------------- /modules/45-logic/20-logic-combine-expressions/index.py: -------------------------------------------------------------------------------- 1 | def is_international_phone(phone: str) -> bool: 2 | return phone[0] == "+" 3 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/index.py: -------------------------------------------------------------------------------- 1 | stark = "Arya" 2 | 3 | # BEGIN 4 | print(f"Do you want to eat, {stark}?") 5 | # END 6 | -------------------------------------------------------------------------------- /modules/35-calling-functions/180-variadic-parameters/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Functions With Varying Numbers of Parameters 3 | tips: [] 4 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/index.py: -------------------------------------------------------------------------------- 1 | def flip_flop(arg: str) -> str: 2 | return "flop" if arg == "flip" else "flip" 3 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | extends: default 4 | 5 | rules: 6 | line-length: disable 7 | empty-lines: disable 8 | trailing-spaces: disable 9 | -------------------------------------------------------------------------------- /modules/20-arithmetics/43-float/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Calcula y muestra en pantalla el producto (multiplicación) de dos números: *0.39* y *0.22* 3 | -------------------------------------------------------------------------------- /modules/45-logic/90-logical-expressions/index.py: -------------------------------------------------------------------------------- 1 | def string_or_not(value: str) -> str: 2 | return isinstance(value, str) and "yes" or "no" 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/600-type-annotations/index.py: -------------------------------------------------------------------------------- 1 | def word_multiply(text: str, repetitions: int) -> str: 2 | return text * repetitions 3 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Imprime en pantalla el último carácter de la cadena que se encuentra en la variable `name`. 3 | -------------------------------------------------------------------------------- /modules/33-data-types/52-data-types-immutability/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: | 3 | The immutability of primitive types 4 | tips: [] 5 | definitions: [] 6 | -------------------------------------------------------------------------------- /modules/40-define-functions/500-named-arguments/index.py: -------------------------------------------------------------------------------- 1 | def trim_and_repeat(text, offset=0, repetitions=1): 2 | return text[offset:] * repetitions 3 | -------------------------------------------------------------------------------- /modules/45-logic/25-logical-operators/index.py: -------------------------------------------------------------------------------- 1 | def is_leap_year(year: int) -> bool: 2 | return year % 400 == 0 or (year % 4 == 0 and year % 100 != 0) 3 | -------------------------------------------------------------------------------- /modules/50-loops/10-while/ru/assets/while.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/50-loops/10-while/ru/assets/while.png -------------------------------------------------------------------------------- /modules/30-variables/10-definition/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Create a variable named `motto` with the contents `What Is Dead May Never Die!`. Print its contents. 3 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/index.py: -------------------------------------------------------------------------------- 1 | def guess_number(guess: int) -> str: 2 | if guess == 42: 3 | return "You win!" 4 | return "Try again!" 5 | -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/ru/assets/strings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/25-strings/10-quotes/ru/assets/strings.png -------------------------------------------------------------------------------- /modules/25-strings/20-string-concatenation/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Display 3 | 4 | ```text 5 | Winter came for the House of Frey. 6 | ``` 7 | 8 | using concatenation. 9 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Создайте константу `DRAGONS_BORN_COUNT` и запишите в неё число 3 — это количество драконов, родившихся у Дайенерис. 2 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/ru/assets/upper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/38-objects/100-objects/ru/assets/upper.png -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/ru/assets/ternary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/48-conditionals/30-if/ru/assets/ternary.png -------------------------------------------------------------------------------- /modules/20-arithmetics/25-operator/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Escribe un programa que calcule la diferencia entre los números `6` y `-81` y muestre la respuesta en pantalla. 3 | -------------------------------------------------------------------------------- /modules/30-variables/10-definition/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Создайте переменную с именем `motto` и содержимым `What Is Dead May Never Die!`. Распечатайте содержимое переменной. 2 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/index.py: -------------------------------------------------------------------------------- 1 | number = 10.1234 2 | 3 | # BEGIN 4 | rounded = round(number, 2) 5 | print(rounded) 6 | # END 7 | -------------------------------------------------------------------------------- /modules/38-objects/200-methods-immutability/index.py: -------------------------------------------------------------------------------- 1 | first_name = " Grigor \n" 2 | 3 | # BEGIN 4 | first_name = first_name.strip() 5 | print(first_name) 6 | # END 7 | -------------------------------------------------------------------------------- /modules/40-define-functions/200-return/index.py: -------------------------------------------------------------------------------- 1 | def truncate(text, length): 2 | # BEGIN 3 | result = f"{text[0:length]}..." 4 | return result 5 | # END 6 | -------------------------------------------------------------------------------- /modules/45-logic/28-logical-negation/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Negation 3 | tips: 4 | - | 5 | [De Morgan's laws](https://en.wikipedia.org/wiki/De_Morgan%27s_laws) 6 | -------------------------------------------------------------------------------- /modules/50-loops/25-iteration-over-string/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Recorrido de cadenas 3 | tips: 4 | - | 5 | [Iteración](https://es.wikipedia.org/wiki/Iteración) 6 | -------------------------------------------------------------------------------- /modules/20-arithmetics/25-operator/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Write a program that calculates the difference between the numbers `6` and `-81` and displays the answer on the screen. 3 | -------------------------------------------------------------------------------- /modules/30-variables/10-definition/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Crea una variable llamada `motto` con el contenido `What Is Dead May Never Die!`. Imprime el contenido de la variable. 3 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Create a constant `DRAGONS_BORN_COUNT` and write the number 3 in it, which is the number of dragons born to Daenerys. 3 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Crea la constante `DRAGONS_BORN_COUNT` y asígnale el valor de 3, que es la cantidad de dragones nacidos de Daenerys. 3 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/31-advanced-strings/25-interpolation/.DS_Store -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Conversión explícita de tipos 3 | tips: 4 | - | 5 | [Tipado](https://es.wikipedia.org/wiki/Tipado) 6 | -------------------------------------------------------------------------------- /modules/35-calling-functions/270-deterministic/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Determinacy 3 | tips: 4 | - | 5 | [Pure function](https://en.wikipedia.org/wiki/Pure_function) 6 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Приведите строку `text` к нижнему регистру и напечатайте её на экран. Пример метода, выполняющего эту задачу приведен в теории. 2 | -------------------------------------------------------------------------------- /modules/40-define-functions/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "7" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/ru/assets/if-statement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/48-conditionals/30-if/ru/assets/if-statement.png -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/ru/assets/hello-world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/10-basics/10-hello-world/ru/assets/hello-world.png -------------------------------------------------------------------------------- /modules/10-basics/40-testing/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "10" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/20-basic/ru/assets/arithmetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/20-arithmetics/20-basic/ru/assets/arithmetics.png -------------------------------------------------------------------------------- /modules/20-arithmetics/20-basic/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "9.0" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "4" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/25-strings/20-string-concatenation/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Выведите на экран фразу используя конкатенацию слов. 2 | 3 | ```text 4 | Winter came for the House of Frey. 5 | ``` 6 | 7 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/31-advanced-strings/90-multiline-strings/.DS_Store -------------------------------------------------------------------------------- /modules/35-calling-functions/270-deterministic/index.py: -------------------------------------------------------------------------------- 1 | # imports are studied on Hexlet 2 | from random import random 3 | 4 | # BEGIN 5 | print(round(random() * 10)) 6 | # END 7 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/index.py: -------------------------------------------------------------------------------- 1 | text = "a MIND needs Books as a Sword needS a WHETSTONE." 2 | 3 | # BEGIN 4 | lower_text = text.lower() 5 | print(lower_text) 6 | # END 7 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/index.py: -------------------------------------------------------------------------------- 1 | text = "When \t\n you play a \t\n game of thrones you win or you die." 2 | 3 | # BEGIN 4 | print(len(text[4:15].strip())) 5 | # END 6 | -------------------------------------------------------------------------------- /modules/40-define-functions/200-return/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Возврат значений 3 | tips: 4 | - | 5 | [return](https://www.w3schools.com/python/ref_keyword_return.asp) 6 | -------------------------------------------------------------------------------- /modules/50-loops/25-iteration-over-string/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Обход строк 3 | tips: 4 | - | 5 | [Итерация](https://ru.wikipedia.org/wiki/Итерация_(программирование)) 6 | -------------------------------------------------------------------------------- /modules/50-loops/55-return-from-loops/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Return from cycles 3 | tips: 4 | - '[List of prime numbers](https://en.wikipedia.org/wiki/List_of_prime_numbers)' 5 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "exercises" 3 | version = "0.1.0" 4 | requires-python = ">=3.11" 5 | 6 | dependencies = [ 7 | "ruff", 8 | "pytest" 9 | ] 10 | -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/ru/assets/instructions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/10-basics/30-instructions/ru/assets/instructions.png -------------------------------------------------------------------------------- /modules/20-arithmetics/25-operator/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Напишите программу, которая посчитает разность (то есть выполнит вычитание `-`) между числами `6` и `-81` и выведет ответ на экран. 2 | -------------------------------------------------------------------------------- /modules/20-arithmetics/25-operator/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "87" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/30-composition/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Реализуйте программу, которая вычисляет и выводит на экран значение выражения: 2 | 3 | ```python 4 | 8 / 2 + 5 - -3 / 2 5 | ``` 6 | -------------------------------------------------------------------------------- /modules/20-arithmetics/40-priority/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "49.0" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/43-float/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "0.0858" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/ru/assets/errors-python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/20-arithmetics/45-linting/ru/assets/errors-python.png -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Comillas 3 | tips: 4 | - > 5 | [f-strings](https://docs.python.org/3/tutorial/inputoutput.html#fancier-output-formatting) 6 | -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Кавычки 3 | tips: 4 | - > 5 | [f-строки](https://docs.python.org/3/tutorial/inputoutput.html#fancier-output-formatting) 6 | -------------------------------------------------------------------------------- /modules/25-strings/30-encoding/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "~\n^\n%" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/30-variables/12-change/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "anneirB" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/30-variables/13-variables-naming/ru/assets/naming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/30-variables/13-variables-naming/ru/assets/naming.png -------------------------------------------------------------------------------- /modules/30-variables/20-magic-numbers/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Números mágicos 3 | tips: 4 | - | 5 | [Números mágicos](https://es.wikipedia.org/wiki/Número_mágico_(informática)) 6 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/ru/assets/symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/31-advanced-strings/30-symbols/ru/assets/symbols.png -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "s" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/33-data-types/50-strong-typing/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Tipado fuerte (o estricto) 3 | tips: 4 | - | 5 | [Tipado](https://en.wikipedia.org/wiki/Strong_and_weak_typing) 6 | -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/index.py: -------------------------------------------------------------------------------- 1 | value = 2.9 2 | 3 | # BEGIN 4 | int_value = int(value) 5 | str_value = str(int_value) 6 | print(str_value + " times") 7 | # END 8 | -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/ru/assets/function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/35-calling-functions/100-call/ru/assets/function.png -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "12" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Make the string `text` lowercase and print it on the screen. An example of a method that performs this task is given in the theory. 3 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "7" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/40-define-functions/200-return/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Devolución de valores 3 | tips: 4 | - | 5 | [return](https://www.w3schools.com/python/ref_keyword_return.asp) 6 | -------------------------------------------------------------------------------- /modules/45-logic/25-logical-operators/assets/lannisters.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/45-logic/25-logical-operators/assets/lannisters.jpg -------------------------------------------------------------------------------- /modules/20-arithmetics/30-composition/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "10.5" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/30-variables/13-variables-naming/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "2" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/30-variables/19-naming-style/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "-2000" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/70-slices/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "xle" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/33-data-types/50-strong-typing/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "13" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/ru/assets/methods-chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/38-objects/500-method-chain/ru/assets/methods-chain.png -------------------------------------------------------------------------------- /modules/40-define-functions/200-return/ru/assets/sum-python.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/40-define-functions/200-return/ru/assets/sum-python.jpg -------------------------------------------------------------------------------- /modules/45-logic/25-logical-operators/ru/assets/even-or-odd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/45-logic/25-logical-operators/ru/assets/even-or-odd.jpg -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "Hello, World!" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/27-commutativity/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "243\n2.0" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Linter 3 | tips: 4 | - | 5 | [PEP8](https://peps.python.org/pep-0008/) 6 | - | 7 | [Ruff](https://docs.astral.sh/ruff/) 8 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Linter 3 | tips: 4 | - | 5 | [PEP8](https://peps.python.org/pep-0008/) 6 | - | 7 | [Ruff](https://docs.astral.sh/ruff/) 8 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Линтер 3 | tips: 4 | - | 5 | [PEP8](https://peps.python.org/pep-0008/) 6 | - | 7 | [Ruff](https://docs.astral.sh/ruff/) 8 | -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Напишите программу, которая выведет на экран в точности как она записана: 2 | 3 | ```text 4 | "Khal Drogo's favorite word is "athjahakar"" 5 | ``` 6 | -------------------------------------------------------------------------------- /modules/33-data-types/50-strong-typing/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Сильная (или Строгая) типизация 3 | tips: 4 | - | 5 | [Типизация](https://ru.wikipedia.org/wiki/Сильная_и_слабая_типизация) 6 | -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Явное преобразование типов 3 | tips: 4 | - | 5 | [Типизация](https://ru.wikipedia.org/wiki/Сильная_и_слабая_типизация) 6 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Redondea el número almacenado en la variable `number` a dos decimales y muestra el resultado en pantalla. 3 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Округлите число, записанное в переменную `number`, до двух знаков после запятой и выведите результат на экран. 2 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Convierte la cadena `text` a minúsculas e imprímela en la pantalla. En la teoría se muestra un ejemplo de un método que realiza esta tarea. 3 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Объекты 3 | tips: 4 | - > 5 | [Методы 6 | строк](https://python.readthedocs.io/en/latest/library/stdtypes.html#string-methods) 7 | -------------------------------------------------------------------------------- /modules/38-objects/200-methods-immutability/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "Grigor" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/45-logic/90-logical-expressions/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Resultados de expresiones lógicas 3 | tips: 4 | - | 5 | [Booleano](https://es.wikipedia.org/wiki/Tipo_de_dato_l%C3%B3gico) 6 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.guess_number(100500) == "Try again!" 6 | assert index.guess_number(42) == "You win!" 7 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/ru/assets/ternary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/48-conditionals/60-ternary-operator/ru/assets/ternary.png -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.flip_flop("flip") == "flop" 6 | assert index.flip_flop("flop") == "flip" 7 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/ru/assets/iterations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/50-loops/20-aggregation-numbers/ru/assets/iterations.png -------------------------------------------------------------------------------- /modules/25-strings/20-string-concatenation/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Imprime en pantalla 3 | 4 | ```text 5 | Winter came for the House of Frey. 6 | ``` 7 | 8 | utilizando la concatenación de palabras. 9 | -------------------------------------------------------------------------------- /modules/30-variables/10-definition/ru/assets/variable-definition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/30-variables/10-definition/ru/assets/variable-definition.png -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Извлечение символов из строки 3 | tips: [] 4 | definitions: 5 | - name: Индекс 6 | description: позиция символа внутри строки. 7 | -------------------------------------------------------------------------------- /modules/33-data-types/40-primitive-data-types/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "-0.304" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/33-data-types/52-data-types-immutability/index.py: -------------------------------------------------------------------------------- 1 | one = "Naharis" 2 | two = "Mormont" 3 | three = "Sand" 4 | 5 | # BEGIN 6 | print(f"{one[2]}{two[1]}{three[3]}{two[4]}{two[2]}") 7 | # END 8 | -------------------------------------------------------------------------------- /modules/33-data-types/52-data-types-immutability/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "hodor" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "2 times" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | There are two variables defined in the program code that contain the names of companies. Calculate their total character length and print it. 3 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Round up the number written in the `number` variable to two decimal places and print the result on the screen. 3 | -------------------------------------------------------------------------------- /modules/35-calling-functions/180-variadic-parameters/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "-3" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Objetos 3 | tips: 4 | - > 5 | [Métodos de 6 | cadenas](https://python.readthedocs.io/en/latest/library/stdtypes.html#string-methods) 7 | -------------------------------------------------------------------------------- /modules/40-define-functions/200-return/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | def test(): 4 | assert index.truncate("hexlet", 2) == "he..." 5 | assert index.truncate("it works!", 4) == "it w..." 6 | -------------------------------------------------------------------------------- /modules/45-logic/10-bool-type/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Logic type 3 | definitions: 4 | - name: “Logic type (bool)” 5 | description: 'a data type with two possible values: `True` or `False`' 6 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/ru/assets/edge-cases.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/50-loops/26-conditions-inside-loops/ru/assets/edge-cases.png -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "Robert\nStannis\nRenly" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/30-variables/15-variables-expressions/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "125.0\n863.75" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/30-variables/20-magic-numbers/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Магические числа 3 | tips: 4 | - > 5 | [Магические 6 | числа](https://ru.wikipedia.org/wiki/Магическое_число_(программирование)) 7 | -------------------------------------------------------------------------------- /modules/33-data-types/50-strong-typing/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Print the result of the expression: `7 - (-8 - -2)`. Try to make the number 7 a string instead of a number. Experiment with other numbers too. 3 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/ru/assets/if-statement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/48-conditionals/60-ternary-operator/ru/assets/if-statement.png -------------------------------------------------------------------------------- /modules/50-loops/10-while/index.py: -------------------------------------------------------------------------------- 1 | def print_reversed_numbers(last_number: int) -> None: 2 | i = last_number 3 | while i > 0: 4 | print(i) 5 | i = i - 1 6 | print("finished!") 7 | -------------------------------------------------------------------------------- /modules/50-loops/70-for/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Цикл For 3 | tips: [] 4 | definitions: 5 | - name: Агрегация 6 | description: Накопление результата во время итераций и работа с ним после цикла. 7 | -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Наберите в редакторе код из задания символ в символ и запустите его на выполнение (кнопка внизу редактора) 2 | 3 | ```python 4 | print('Hello, World!') 5 | ``` 6 | -------------------------------------------------------------------------------- /modules/10-basics/50-syntax-errors/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "What Is Dead May Never Die" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/30-variables/10-definition/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "What Is Dead May Never Die!" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Creación (definición) de funciones 3 | tips: 4 | - | 5 | [Naming en programación](https://codica.la/blog/naming-in-programming) 6 | -------------------------------------------------------------------------------- /modules/48-conditionals/65-match/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Match Operator 3 | tips: 4 | - > 5 | [Match](https://docs.python.org/3/reference/compound_stmts.html#the-match-statement) 6 | definitions: [] 7 | -------------------------------------------------------------------------------- /modules/48-conditionals/65-match/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Operador Match 3 | tips: 4 | - > 5 | [Match](https://docs.python.org/3/reference/compound_stmts.html#the-match-statement) 6 | definitions: [] 7 | -------------------------------------------------------------------------------- /modules/48-conditionals/65-match/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Оператор Match 3 | tips: 4 | - > 5 | [Match](https://docs.python.org/3/reference/compound_stmts.html#the-match-statement) 6 | definitions: [] 7 | -------------------------------------------------------------------------------- /modules/50-loops/10-while/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: While Loop 3 | tips: [] 4 | definitions: 5 | - name: While Loop 6 | description: an instruction to repeat the code as long as a given condition is met 7 | -------------------------------------------------------------------------------- /modules/30-variables/12-change/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Changing variables 3 | tips: [] 4 | definitions: 5 | - name: Variable 6 | description: a way to save information and name it for later use in code. 7 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "Do you want to eat, Arya?" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/ru/assets/number-as-string.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/33-data-types/55-data-types-casting/ru/assets/number-as-string.png -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | В коде программы определены две переменные, содержащие имена компаний. Посчитайте их общую длину в символах используя функцию `len()` и выведите ее на экран. 2 | -------------------------------------------------------------------------------- /modules/35-calling-functions/270-deterministic/ru/assets/deterministic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/35-calling-functions/270-deterministic/ru/assets/deterministic.png -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/ru/assets/define_python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/40-define-functions/100-define-function/ru/assets/define_python.png -------------------------------------------------------------------------------- /modules/40-define-functions/400-default-parameters/index.py: -------------------------------------------------------------------------------- 1 | def get_hidden_card(card_number, stars_count=4): 2 | visible_digits_line = card_number[-4:] 3 | return f"{'*' * stars_count}{visible_digits_line}" 4 | -------------------------------------------------------------------------------- /modules/20-arithmetics/43-float/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Floating point numbers 3 | tips: 4 | - > 5 | [What you need to know about floating point 6 | arithmetic](https://www.validlab.com/goldberg/paper.pdf) 7 | -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = '"Khal Drogo\'s favorite word is "athjahakar""' 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/30-variables/19-naming-style/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Variable naming 3 | tips: [] 4 | definitions: 5 | - name: Coding standard 6 | description: a set of syntactic and stylistic rules for writing code. 7 | -------------------------------------------------------------------------------- /modules/30-variables/20-magic-numbers/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "Rooms in King Balon's Castles:\n102" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/70-slices/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | The variable `value` contains the value `Hexlet`. Extract from it and display the slice that gets the substring `xle`. This task can be done in different ways. 3 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/description.ru.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Глубже про строки 4 | description: 5 | Продолжаем изучать строки и их связь с переменными. Разбираем интерполяцию, извлечение символов, слайсы и другое 6 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Default Arguments 3 | tips: [] 4 | definitions: 5 | - name: Default setting 6 | description: optional function parameter 7 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "10.12" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Cadena de llamadas 3 | definitions: 4 | - name: Método 5 | description: | 6 | es una función o procedimiento que pertenece a una clase u objeto. 7 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Цепочка вызовов 3 | definitions: 4 | - name: Метод 5 | description: | 6 | это функция или процедура, принадлежащая какому-то классу или объекту. 7 | -------------------------------------------------------------------------------- /modules/48-conditionals/50-else-if/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Конструкция else + if = elif 3 | tips: [] 4 | definitions: 5 | - name: else + if = elif 6 | description: способ задать несколько альтернативных условий. 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/40-priority/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Dada la expresión `70 * 3 + 4 / 8 + 2`. 3 | 4 | Coloca paréntesis de manera que ambas sumas (`3 + 4`) y (`8 + 2`) se calculen primero. Imprime el resultado en pantalla. 5 | -------------------------------------------------------------------------------- /modules/25-strings/20-string-concatenation/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "Winter came for the House of Frey." 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/30-symbols/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Extracción de caracteres de una cadena 3 | tips: [] 4 | definitions: 5 | - name: Índice 6 | description: La posición del carácter dentro de una cadena. 7 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/70-slices/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | В переменной `value` лежит значение `Hexlet`. Извлеките из него и выведите на экран срез, который получит подстроку `xle`. Это задание можно сделать разными способами. 2 | -------------------------------------------------------------------------------- /modules/35-calling-functions/150-calling-functions-expression/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "First: N\nLast: t" 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/35-calling-functions/180-variadic-parameters/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Calculate the minimum number (not mentally) from 3, 10, 22, -3, 0 - and display it. Use the `min()` function, which works in the same way as `max()`. 3 | -------------------------------------------------------------------------------- /modules/38-objects/100-objects/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = "a mind needs books as a sword needs a whetstone." 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/38-objects/200-methods-immutability/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Inmutabilidad 3 | definitions: 4 | - name: Método 5 | description: | 6 | es una función o procedimiento que pertenece a una clase u objeto. 7 | -------------------------------------------------------------------------------- /modules/45-logic/20-logic-combine-expressions/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert not index.is_international_phone("89602223423") 6 | assert index.is_international_phone("+79602223423") 7 | -------------------------------------------------------------------------------- /modules/48-conditionals/50-else-if/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: The construct else + if = elif 3 | tips: [] 4 | definitions: 5 | - name: else + if = elif 6 | description: a way of setting several alternative conditions. 7 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/ru/assets/conditions-inside-loops.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/50-loops/26-conditions-inside-loops/ru/assets/conditions-inside-loops.png -------------------------------------------------------------------------------- /modules/10-basics/20-comments/test_code.py: -------------------------------------------------------------------------------- 1 | def test(): 2 | with open("index.py") as file: 3 | comment = file.read().rstrip() 4 | assert comment == "# You know nothing, Jon Snow!" 5 | print(comment) 6 | -------------------------------------------------------------------------------- /modules/30-variables/15-variables-expressions/index.py: -------------------------------------------------------------------------------- 1 | euros_count = 100 2 | 3 | # BEGIN 4 | dollars_count = euros_count * 1.25 5 | print(dollars_count) 6 | yuans_count = dollars_count * 6.91 7 | print(yuans_count) 8 | # END 9 | -------------------------------------------------------------------------------- /modules/30-variables/20-magic-numbers/index.py: -------------------------------------------------------------------------------- 1 | king = "Rooms in King Balon's Castles:" 2 | 3 | # BEGIN 4 | number_of_castles = 6 5 | rooms_per_castle = 17 6 | print(king) 7 | print(number_of_castles * rooms_per_castle) 8 | # END 9 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/70-slices/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | La variable `value` contiene el valor `Hexlet`. Extrae y muestra en pantalla un recorte que obtenga la subcadena `xle` de ella. Puedes hacer esto de diferentes maneras. 3 | -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | En el código del programa se han definido dos variables que contienen nombres de empresas. Calcula la longitud total de los nombres en caracteres y muéstrala en pantalla. 3 | -------------------------------------------------------------------------------- /modules/38-objects/200-methods-immutability/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Неизменяемость 3 | definitions: 4 | - name: Метод 5 | description: | 6 | это функция или процедура, принадлежащая какому-то классу или объекту. 7 | -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Creating (defining) functions 3 | tips: 4 | - > 5 | [Naming in 6 | programming](https://hexlet.io/blog/posts/code-complete-naming-in-programming) 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/30-composition/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Композиция операций 3 | tips: [] 4 | definitions: 5 | - name: Композиция 6 | description: | 7 | метод объединения нескольких простых операций в одну сложную. 8 | -------------------------------------------------------------------------------- /modules/35-calling-functions/150-calling-functions-expression/index.py: -------------------------------------------------------------------------------- 1 | text = "Never forget what you are, for surely the world will not" 2 | 3 | # BEGIN 4 | result = f"First: {text[0]}\nLast: {text[-1]}" 5 | print(result) 6 | # END 7 | -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: ¡Hola, Mundo! 3 | tips: 4 | - > 5 | [Un poco sobre 'Hello, 6 | World!'](https://codica.la/blog/mi-gente-me-entiende-la-historia-de-la-frase-hello-world-y-sus-analogos) 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/27-commutativity/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Write a program that calculates and displays sequentially (one value per line) the values of the following mathematical expressions: "3 to the power of 5" and "-8 divided by -4". 3 | -------------------------------------------------------------------------------- /modules/30-variables/13-variables-naming/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Create a variable that describes the number of your brothers and assign it the value *2*. Print its contents. Then compare your name with the name used in the teacher's solution. 3 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Multi-line строки 3 | definitions: [] 4 | tips: 5 | - > 6 | [Multi-line 7 | строки](https://www.w3schools.com/python/gloss_python_multi_line_strings.asp) 8 | -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/index.py: -------------------------------------------------------------------------------- 1 | company1 = "Apple" 2 | company2 = "Samsung" 3 | 4 | # BEGIN 5 | company1_len = len(company1) 6 | company2_len = len(company2) 7 | 8 | print(company1_len + company2_len) 9 | # END 10 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Argumentos por defecto 3 | tips: [] 4 | definitions: 5 | - name: Parámetro por defecto 6 | description: parámetro opcional de una función 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/40-priority/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | The calculation is given `70 * 3 + 4 / 8 + 2`. 3 | 4 | Place parentheses so that both additions (`3 + 4`) и (`8 + 2`) were calculated in the first place. Print the result on the screen. 5 | -------------------------------------------------------------------------------- /modules/35-calling-functions/180-variadic-parameters/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Посчитайте программно (а не в голове) минимальное число среди 3, 10, 22, -3, 0 — и выведите его на экран. Воспользуйтесь функцией `min()`, которая работает аналогично `max()`. 2 | -------------------------------------------------------------------------------- /modules/45-logic/10-bool-type/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert not index.is_pensioner(23) 6 | assert index.is_pensioner(70) 7 | assert index.is_pensioner(60) 8 | assert not index.is_pensioner(59) 9 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Условная конструкция (if) 3 | tips: [] 4 | definitions: 5 | - name: Условная конструкция 6 | description: 'способ задать условие для выполнения кода. Например, `if x > 10: ... `' 7 | -------------------------------------------------------------------------------- /modules/50-loops/25-iteration-over-string/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test(): 5 | assert index.add_spaces("hex") == "h e x" 6 | assert index.add_spaces("Arya") == "A r y a" 7 | assert index.add_spaces("a") == "a" 8 | -------------------------------------------------------------------------------- /modules/10-basics/50-syntax-errors/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | This assignment is not directly related to the lesson. But it will be useful to practice with the output on the screen. 3 | 4 | Display: 5 | 6 | ```text 7 | What Is Dead May Never Die 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/description.en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Deeper About Lines 4 | description: 5 | Continuing to study strings and their relationship to variables. We'll take a look at interpolation, character extraction, slice, and more. 6 | -------------------------------------------------------------------------------- /modules/50-loops/23-aggregation-strings/index.py: -------------------------------------------------------------------------------- 1 | def join_numbers_from_range(start: int, end: int) -> str: 2 | i = start 3 | result = "" 4 | while i <= end: 5 | result = result + str(i) 6 | i = i + 1 7 | return result 8 | -------------------------------------------------------------------------------- /modules/50-loops/70-for/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ciclo For 3 | tips: [] 4 | definitions: 5 | - name: Agregación 6 | description: >- 7 | Acumulación de resultados durante las iteraciones y manejo de estos 8 | después del ciclo. 9 | -------------------------------------------------------------------------------- /modules/50-loops/70-for/index.py: -------------------------------------------------------------------------------- 1 | def filter_string(text: str, char: str) -> str: 2 | result = "" 3 | for current_char in text: 4 | if current_char.upper() != char.upper(): 5 | result += current_char 6 | return result 7 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Print the result of the following calculation: "the difference between five squared and the product of three and seven". Write the code so that each operator is separated from the operands by spaces. 3 | -------------------------------------------------------------------------------- /modules/25-strings/20-string-concatenation/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Concatenation 3 | definitions: 4 | - name: Concatenation 5 | description: > 6 | the operation of joining two strings. For example, `print("King's " + ' 7 | Landing')` 8 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Cadenas de varias líneas 3 | definitions: [] 4 | tips: 5 | - > 6 | [Cadenas de varias 7 | líneas](https://www.w3schools.com/python/gloss_python_multi_line_strings.asp) 8 | -------------------------------------------------------------------------------- /modules/33-data-types/50-strong-typing/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Выведите на экран результат выражения: `7 - (-8 - -2)`. 2 | 3 | Попробуйте сделать число 7 не числом, а строкой: `'7' - (-8 - -2)`. Сработает ли такой код? Поэкспериментируйте с другими числами тоже. 4 | -------------------------------------------------------------------------------- /modules/35-calling-functions/180-variadic-parameters/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Calcule programáticamente (no mentalmente) el número mínimo entre 3, 10, 22, -3, 0, y muéstrelo en pantalla. Utilice la función `min()`, que funciona de manera similar a `max()`. 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | from hexlet.test import expect_output 3 | 4 | 5 | def test(capsys): 6 | index.print_motto() 7 | expected = "Winter is coming" 8 | expect_output(capsys, expected) 9 | -------------------------------------------------------------------------------- /modules/48-conditionals/40-if-else/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: else 3 | tips: [] 4 | definitions: 5 | - name: else 6 | description: >- 7 | a way to specify the block of code that'll be executed if an `if` 8 | condition is not satisfied. 9 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/index.py: -------------------------------------------------------------------------------- 1 | def multiply_numbers_from_range(start: int, finish: int) -> int: 2 | i = start 3 | result = 1 4 | while i <= finish: 5 | result = result * i 6 | i = i + 1 7 | return result 8 | -------------------------------------------------------------------------------- /modules/10-basics/50-syntax-errors/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Esta tarea no está directamente relacionada con la lección. Pero será útil practicar la impresión en la pantalla. 3 | 4 | Imprime en la pantalla: 5 | 6 | ```text 7 | What Is Dead May Never Die 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/20-arithmetics/27-commutativity/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Escriba un programa que calcule y muestre en pantalla, de forma secuencial (un valor por línea), los resultados de las siguientes expresiones matemáticas: "3 elevado a la 5" y "-8 dividido por -4". 3 | -------------------------------------------------------------------------------- /modules/20-arithmetics/40-priority/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Prioridad 3 | tips: [] 4 | definitions: 5 | - name: Expresión 6 | description: > 7 | una secuencia de acciones sobre datos que conduce a algún resultado que se 8 | puede utilizar. 9 | -------------------------------------------------------------------------------- /modules/30-variables/12-change/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Изменение переменной 3 | tips: [] 4 | definitions: 5 | - name: Переменная 6 | description: >- 7 | способ сохранить информацию и дать ей имя для последующего использования в 8 | коде. 9 | -------------------------------------------------------------------------------- /modules/35-calling-functions/135-calling-functions-default-params/ru/assets/default-parameters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hexlet-basics/exercises-python/HEAD/modules/35-calling-functions/135-calling-functions-default-params/ru/assets/default-parameters.png -------------------------------------------------------------------------------- /modules/45-logic/28-logical-negation/index.py: -------------------------------------------------------------------------------- 1 | def is_palindrome(word: str) -> bool: 2 | lower_word = word.lower() 3 | return lower_word == lower_word[::-1] 4 | 5 | 6 | def is_not_palindrome(word: str) -> bool: 7 | return not is_palindrome(word) 8 | -------------------------------------------------------------------------------- /modules/48-conditionals/50-else-if/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Construcción else + if = elif 3 | tips: [] 4 | definitions: 5 | - name: Condicionales else + if = elif 6 | description: Un recurso para especificar condiciones alternativas, según sea el caso 7 | -------------------------------------------------------------------------------- /modules/10-basics/40-testing/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Выведите на экран число 10 по примеру из теории. Проверьте как работает система тестирования, попробуйте вывести что-нибудь другое и посмотрите на вывод. Это поможет научиться его распознавать и правильно анализировать. 2 | -------------------------------------------------------------------------------- /modules/25-strings/15-escape-characters/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = '- Did Joffrey agree?\n- He did. He also said "I love using \\n".' # noqa: E501 6 | expect_output(capsys, expected) 7 | -------------------------------------------------------------------------------- /modules/30-variables/12-change/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Cambio de variable 3 | tips: [] 4 | definitions: 5 | - name: Variable 6 | description: >- 7 | una forma de almacenar información y darle un nombre para su uso posterior 8 | en el código. 9 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Print the string, `Do you want to eat, ? Where the variable `stark` should be used instead of ``. The output should look like this: 3 | 4 | ```text 5 | Do you want to eat, Arya? 6 | ``` 7 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/description.es.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Más sobre cadenas de texto 4 | description: 5 | Continuamos aprendiendo sobre cadenas de texto y su relación con las variables. Exploramos la interpolación, extracción de caracteres, slices y más. 6 | -------------------------------------------------------------------------------- /modules/50-loops/55-return-from-loops/index.py: -------------------------------------------------------------------------------- 1 | def is_contains_char(string: str, char: str) -> bool: 2 | index = 0 3 | while index < len(string): 4 | if string[index] == char: 5 | return True 6 | index += 1 7 | return False 8 | -------------------------------------------------------------------------------- /modules/20-arithmetics/30-composition/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Composición de operaciones 3 | tips: [] 4 | definitions: 5 | - name: Composición 6 | description: > 7 | método de combinar varias operaciones simples en una sola operación 8 | compleja. 9 | -------------------------------------------------------------------------------- /modules/33-data-types/50-strong-typing/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Muestre en pantalla el resultado de la expresión: `7 - (-8 - -2)`. Intente hacer que el número 7 sea una cadena de texto en lugar de un número. ¿Funcionará este código? Experimente también con otros números. 3 | -------------------------------------------------------------------------------- /modules/48-conditionals/40-if-else/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Условная конструкция else 3 | tips: [] 4 | definitions: 5 | - name: else 6 | description: >- 7 | способ задать блок кода, который будет выполнен, если условие с `if` не 8 | удовлетворено. 9 | -------------------------------------------------------------------------------- /modules/20-arithmetics/40-priority/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Приоритет 3 | tips: [] 4 | definitions: 5 | - name: Выражение 6 | description: > 7 | последовательность действий над данными, приводящая к каком-то результату, 8 | который можно использовать. 9 | -------------------------------------------------------------------------------- /modules/30-variables/13-variables-naming/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Crea una variable que describa la cantidad de hermanos que tienes y asígnale el valor *2*. Imprime el contenido de la variable. Luego, compara tu nombre con el nombre que se utiliza en la solución del profesor. 3 | -------------------------------------------------------------------------------- /modules/40-define-functions/200-return/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement the `say_hurray_three_times()` function, which returns the string 'hurray! hurray! hurray!'. 3 | 4 | ```python 5 | hurray = say_hurray_three_times() 6 | print(hurray) # => hurray! hurray! hurray! 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/40-define-functions/200-return/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa la función `say_hurray_three_times()`, que devuelve la cadena 'hurray! hurray! hurray!'. 3 | 4 | ```python 5 | hurray = say_hurray_three_times() 6 | print(hurray) # => hurray! hurray! hurray! 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Conditional Constructions (if) 3 | tips: [] 4 | definitions: 5 | - name: Conditional Design. 6 | description: >- 7 | the way to set a condition for code execution. For example, `if x > 10: . 8 | ` 9 | -------------------------------------------------------------------------------- /modules/20-arithmetics/30-composition/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Write a program that calculates and prints the value of this expression: 3 | 4 | ```text 5 | 8 / 2 + 5 - -3 / 2 6 | ``` 7 | 8 | Don't calculate anything manually, your program should do all the calculations on its own. 9 | -------------------------------------------------------------------------------- /modules/20-arithmetics/45-linting/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Imprime en pantalla el resultado de la siguiente operación: "la diferencia entre cinco al cuadrado y el producto de tres por siete". Escribe el código de manera que cada operador esté separado de los operandos por espacios. 3 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Constants 3 | tips: [] 4 | definitions: 5 | - name: Constant 6 | description: >- 7 | a way to store information and name it for later use in code; constants 8 | cannot be changed, unlike variables. 9 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Interpolation 3 | tips: [] 4 | definitions: 5 | - name: Interpolation 6 | description: >- 7 | a method for obtaining a complex string from several simple ones using 8 | special templates 9 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Imprime en pantalla la cadena `Do you want to eat, ?`, donde en lugar de `` se debe utilizar la variable `stark`. La salida debe ser la siguiente: 3 | 4 | ```text 5 | Do you want to eat, Arya? 6 | ``` 7 | -------------------------------------------------------------------------------- /modules/48-conditionals/40-if-else/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Estructura condicional else 3 | tips: [] 4 | definitions: 5 | - name: else 6 | description: >- 7 | forma de especificar un bloque de código que se ejecutará si la condición 8 | del `if` no se cumple. 9 | -------------------------------------------------------------------------------- /modules/50-loops/23-aggregation-strings/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.join_numbers_from_range(2, 2) == "2" 6 | assert index.join_numbers_from_range(1, 5) == "12345" 7 | assert index.join_numbers_from_range(10, 12) == "101112" 8 | -------------------------------------------------------------------------------- /modules/30-variables/description.en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Variables 4 | description: 5 | Information can be put into special "repositories" and then used as many times as you like. These storages are called variables, and they help simplify code and reduce unnecessary repetition. 6 | -------------------------------------------------------------------------------- /modules/30-variables/description.ru.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Переменные 4 | description: 5 | Информацию можно помещать в специальные «хранилища», а потом использовать сколько угодно раз. Эти хранилища называются переменными, и они помогают упростить код и сократить лишние повторения. 6 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Выведите на экран строку `Do you want to eat, ?`. Где вместо `` должна использоваться уже определенная переменная `stark`. Вывод должен получиться таким: 2 | 3 | ```text 4 | Do you want to eat, Arya? 5 | ``` 6 | -------------------------------------------------------------------------------- /modules/45-logic/15-bool-strings/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | def test1(): 4 | assert not index.is_long_word("apple") # 5 символов → False 5 | assert index.is_long_word("banana") # 6 символов → True 6 | assert index.is_long_word("pineapple") # 9 символов → True 7 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Estructura condicional (if) 3 | tips: [] 4 | definitions: 5 | - name: Estructura condicional 6 | description: >- 7 | forma de establecer una condición para ejecutar código. Por ejemplo, `if x 8 | > 10: ... ` 9 | -------------------------------------------------------------------------------- /spec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | language: 4 | docker_image: "ghcr.io/hexlet-basics/exercises-python" 5 | extension: python 6 | exercise_filename: index.py 7 | exercise_test_filename: test_code.py 8 | learn_as: first_language 9 | progress: completed 10 | name: Python 11 | -------------------------------------------------------------------------------- /modules/10-basics/20-comments/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Comments 3 | tips: [] 4 | definitions: 5 | - name: Comments 6 | description: > 7 | text in the program code that does not affect the functionality and is 8 | added by programmers for themselves and their colleagues. 9 | -------------------------------------------------------------------------------- /modules/20-arithmetics/30-composition/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa un programa que calcule y muestre en pantalla el valor de la expresión: 3 | 4 | ```text 5 | 8 / 2 + 5 - -3 / 2 6 | ``` 7 | 8 | No calcules nada por tu cuenta, tu programa debe realizar todos los cálculos por sí mismo. 9 | -------------------------------------------------------------------------------- /modules/10-basics/50-syntax-errors/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Это задание не связано с уроком напрямую. Но будет полезным потренироваться с выводом на экран. 2 | 3 | Выведите на экран символ в символ с учетом регистра (заглавная или строчная буква): 4 | 5 | ```text 6 | What Is Dead May Never Die 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/25-strings/30-encoding/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Encoding 3 | tips: 4 | - | 5 | [What are encodings?](https://guides.hexlet.io/en/encoding/) 6 | definitions: 7 | - name: Encoding 8 | description: a set of characters encoded with numbers to represent text electronically. 9 | -------------------------------------------------------------------------------- /modules/35-calling-functions/150-calling-functions-expression/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Llamada a una función - expresión 3 | definitions: 4 | - name: Expresión 5 | description: > 6 | una secuencia de acciones sobre datos que conduce a un resultado que se 7 | puede utilizar. 8 | -------------------------------------------------------------------------------- /modules/50-loops/10-while/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Цикл While 3 | tips: 4 | - | 5 | [Цикл while](https://www.w3schools.com/python/python_while_loops.asp) 6 | definitions: 7 | - name: Цикл While 8 | description: инструкция для повторения кода, пока удовлетворяется какое-то условие. 9 | -------------------------------------------------------------------------------- /modules/35-calling-functions/270-deterministic/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def check(output): 5 | value = int(output) 6 | 7 | assert value >= 0 8 | assert value <= 10 9 | 10 | 11 | def test(capsys): 12 | expect_output(capsys, check) 13 | -------------------------------------------------------------------------------- /modules/50-loops/10-while/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ciclo While 3 | tips: 4 | - | 5 | [Ciclo while](https://www.w3schools.com/python/python_while_loops.asp) 6 | definitions: 7 | - name: Ciclo While 8 | description: una instrucción para repetir código mientras se cumpla una condición. 9 | -------------------------------------------------------------------------------- /modules/50-loops/25-iteration-over-string/index.py: -------------------------------------------------------------------------------- 1 | def add_spaces(text: str) -> str: 2 | result = "" 3 | i = 0 4 | while i < len(text): 5 | if i > 0: 6 | result = result + " " 7 | result = result + text[i] 8 | i = i + 1 9 | return result 10 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.count_chars("axe", "a") == 1 6 | assert index.count_chars("", "a") == 0 7 | assert index.count_chars("opPa", "p") == 2 8 | assert index.count_chars("opPa", "P") == 2 9 | -------------------------------------------------------------------------------- /modules/30-variables/19-naming-style/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Именование переменных 3 | tips: 4 | - | 5 | [Snake case](https://ru.wikipedia.org/wiki/Snake_case) 6 | definitions: 7 | - name: Стандарт кодирования 8 | description: набор синтаксических и стилистических правил написания кода. 9 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Константы 3 | tips: [] 4 | definitions: 5 | - name: Константа 6 | description: >- 7 | способ сохранить информацию и дать ей имя для последующего использования в 8 | коде; константы нельзя изменять, в отличие от переменных. 9 | -------------------------------------------------------------------------------- /modules/35-calling-functions/150-calling-functions-expression/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Вызов функции — выражение 3 | definitions: 4 | - name: Выражение 5 | description: > 6 | последовательность действий над данными, приводящая к каком-то результату, 7 | который можно использовать. 8 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ternary operator 3 | tips: [] 4 | definitions: 5 | - name: Ternary operator 6 | description: > 7 | a way to turn a simple conditional instruction into an expression, such as 8 | `number if number >= 0 else -number`. 9 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Тернарный оператор 3 | tips: [] 4 | definitions: 5 | - name: Тернарный оператор 6 | description: > 7 | способ превратить простую условную инструкцию в выражение, например, 8 | `number if number >= 0 else -number`. 9 | -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Display three names, one after another: _Robert_, _Stannis_, _Renly_. The result should be that the following is shown on the screen: 2 | 3 | ```text 4 | Robert 5 | Stannis 6 | Renly 7 | ``` 8 | 9 | For each name, use Python's own `print()` call. 10 | -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Выведите на экран друг за другом три имени: *Robert*, *Stannis*, *Renly*. В результате на экране должно отобразиться: 2 | 3 | ```text 4 | Robert 5 | Stannis 6 | Renly 7 | ``` 8 | 9 | Для каждого имени используйте свой собственный вызов `print()`. 10 | -------------------------------------------------------------------------------- /modules/30-variables/description.es.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Variables 4 | description: 5 | La información se puede colocar en "almacenes" especiales y luego utilizarla tantas veces como sea necesario. Estos almacenes se llaman variables y ayudan a simplificar el código y reducir repeticiones innecesarias. 6 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/index.py: -------------------------------------------------------------------------------- 1 | # BEGIN 2 | text = """Lannister, Targaryen, Baratheon, Stark, Tyrell... 3 | they're all just spokes on a wheel. 4 | This one's on top, then that one's on top, and on and on it spins, 5 | crushing those on the ground.""" 6 | # END 7 | 8 | print(text) 9 | -------------------------------------------------------------------------------- /modules/33-data-types/52-data-types-immutability/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: | 3 | Неизменяемость примитивных типов 4 | tips: [] 5 | definitions: 6 | - name: Неизменяемость 7 | description: > 8 | состояние, при котором объект, переменная не могут быть изменены после 9 | создания 10 | -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Создание (определение) функций 3 | tips: 4 | - > 5 | [Именование в 6 | программировании](https://ru.hexlet.io/blog/posts/naming-in-programming?utm_source=code-basics&utm_medium=referral&utm_campaign=blog&utm_content=lesson) 7 | -------------------------------------------------------------------------------- /modules/45-logic/28-logical-negation/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Negación 3 | tips: 4 | - | 5 | [Leyes de De Morgan](https://es.wikipedia.org/wiki/Leyes_de_De_Morgan) 6 | definitions: 7 | - name: Negación 8 | description: | 9 | operación lógica que cambia el valor lógico al opuesto. 10 | -------------------------------------------------------------------------------- /modules/48-conditionals/50-else-if/index.py: -------------------------------------------------------------------------------- 1 | def who_is_this_house_to_starks(house_name: str) -> str: 2 | if house_name == "Karstark" or house_name == "Tully": 3 | return "friend" 4 | elif house_name == "Lannister" or house_name == "Frey": 5 | return "enemy" 6 | return "neutral" 7 | -------------------------------------------------------------------------------- /modules/50-loops/55-return-from-loops/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Возврат из циклов 3 | tips: 4 | - '[Список простых чисел](https://ru.wikipedia.org/wiki/Список_простых_чисел)' 5 | definitions: 6 | - name: Агрегация 7 | description: Накопление результата во время итераций и работа с ним после цикла. 8 | -------------------------------------------------------------------------------- /modules/45-logic/25-logical-operators/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.is_leap_year(2016) 6 | assert index.is_leap_year(2000) 7 | assert not index.is_leap_year(2017) 8 | assert not index.is_leap_year(2018) 9 | assert not index.is_leap_year(1900) 10 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/index.py: -------------------------------------------------------------------------------- 1 | def count_chars(string: str, char: str) -> int: 2 | index = 0 3 | count = 0 4 | while index < len(string): 5 | if string[index].upper() == char.upper(): 6 | count = count + 1 7 | index = index + 1 8 | return count 9 | -------------------------------------------------------------------------------- /modules/50-loops/80-for-in-range/test_code.py: -------------------------------------------------------------------------------- 1 | from index import fizzbuzz 2 | 3 | 4 | def test(): 5 | assert fizzbuzz(1) == "1" 6 | assert fizzbuzz(3) == "1 2 Fizz" 7 | assert fizzbuzz(5) == "1 2 Fizz 4 Buzz" 8 | assert fizzbuzz(15) == "1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz" 9 | -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Привет, Мир! 3 | tips: 4 | - > 5 | [Немного о 'Hello, 6 | World!'](https://ru.hexlet.io/blog/posts/moy-chelovek-menya-ponimaet-istoriya-frazy-hello-world-i-ee-analogov?utm_source=code-basics&utm_medium=referral&utm_campaign=blog&utm_content=lesson) 7 | -------------------------------------------------------------------------------- /modules/30-variables/19-naming-style/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Nomenclatura de variables 3 | tips: 4 | - | 5 | [Snake case](https://es.wikipedia.org/wiki/Snake_case) 6 | definitions: 7 | - name: Estándar de codificación 8 | description: conjunto de reglas sintácticas y estilísticas para escribir código. 9 | -------------------------------------------------------------------------------- /modules/40-define-functions/400-default-parameters/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test(): 5 | assert index.get_hidden_card("1234123412341234") == "****1234" 6 | assert index.get_hidden_card("1234123412344321") == "****4321" 7 | assert index.get_hidden_card("1234123412344321", 3) == "***4321" 8 | -------------------------------------------------------------------------------- /modules/48-conditionals/40-if-else/index.py: -------------------------------------------------------------------------------- 1 | def normalize_url(url: str) -> str: 2 | prefix = "https://" 3 | if url[:8] == prefix: 4 | return url 5 | else: 6 | if url[:7] == "http://": 7 | return prefix + url[7:] 8 | else: 9 | return prefix + url 10 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Operador ternario 3 | tips: [] 4 | definitions: 5 | - name: Operador ternario 6 | description: > 7 | una forma de convertir una instrucción condicional simple en una 8 | expresión, por ejemplo, `number if number >= 0 else -number`. 9 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Агрегация данных (Числа) 3 | tips: 4 | - | 5 | [Итерация](https://ru.wikipedia.org/wiki/Итерация_(программирование)) 6 | definitions: 7 | - name: Агрегация 8 | description: Накопление результата во время итераций и работа с ним после цикла. 9 | -------------------------------------------------------------------------------- /modules/50-loops/23-aggregation-strings/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Агрегация данных (Строки) 3 | tips: 4 | - | 5 | [Итерация](https://ru.wikipedia.org/wiki/Итерация_(программирование)) 6 | definitions: 7 | - name: Агрегация 8 | description: Накопление результата во время итераций и работа с ним после цикла. 9 | -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Imprime en la pantalla uno tras otro tres nombres: *Robert*, *Stannis*, *Renly*. Como resultado, se debe mostrar en la pantalla: 2 | 3 | ```text 4 | Robert 5 | Stannis 6 | Renly 7 | ``` 8 | 9 | Por cada nombre o designación, usa nuevamente la orden de `print()`. 10 | -------------------------------------------------------------------------------- /modules/30-variables/18-variable-concatenation/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = """Hello, Joffrey! 6 | Here is important information about your account security. 7 | We couldn't verify your mother's maiden name.""" 8 | expect_output(capsys, expected) 9 | -------------------------------------------------------------------------------- /modules/33-data-types/52-data-types-immutability/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: | 3 | Inmutabilidad de los tipos de datos primitivos 4 | tips: [] 5 | definitions: 6 | - name: Inmutabilidad 7 | description: > 8 | estado en el que un objeto o variable no puede ser cambiado después de su 9 | creación 10 | -------------------------------------------------------------------------------- /modules/50-loops/23-aggregation-strings/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa la función `join_numbers_from_range()`, que une todos los números de un rango en una cadena: 3 | 4 | ```python 5 | join_numbers_from_range(1, 1) # '1' 6 | join_numbers_from_range(2, 3) # '23' 7 | join_numbers_from_range(5, 10) # '5678910' 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/50-loops/25-iteration-over-string/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Напишите функцию `add_spaces(text)`, которая возвращает строку, составленную из символов исходной строки разделенных пробелом. 2 | 3 | Пример работы: 4 | 5 | ```python 6 | print(add_spaces("hex")) # => h e x 7 | print(add_spaces("Arya")) # => A r y a 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Функция из теории учитывает регистр букв. То есть `A` и `a` с её точки зрения разные символы. Реализуйте вариант этой же функции, так чтобы регистр букв был не важен: 2 | 3 | ```python 4 | count_chars('HexlEt', 'e') # 2 5 | count_chars('HexlEt', 'E') # 2 6 | ``` 7 | -------------------------------------------------------------------------------- /modules/25-strings/15-escape-characters/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Write a program that displays on this the screen: 2 | 3 | ```text 4 | - Did Joffrey agree? 5 | - He did. He also said "I love using \n". 6 | ``` 7 | 8 | This program should have only one `print()`, but the result on the screen should look exactly like the one shown above. 9 | -------------------------------------------------------------------------------- /modules/25-strings/15-escape-characters/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Escribe un programa que muestre en pantalla: 3 | 4 | - Did Joffrey agree? 5 | - He did. He also said "I love using \n". 6 | 7 | El programa debe utilizar solo una llamada a `print()`, pero el resultado en pantalla debe ser exactamente como se muestra arriba. 8 | -------------------------------------------------------------------------------- /modules/30-variables/13-variables-naming/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Создайте переменную, описывающую количество своих братьев, и присвойте ей значение *2*. Распечатайте содержимое переменной. 2 | 3 | ## Дополнительно 4 | 5 | Когда упражнение будет пройдено, сравните имя вашей переменной с именем, которое используется в учительском решении. 6 | -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Output the string `2 times` obtained from the number 2.9 (stored in the variable `value`) and the string `times` using type conversions and concatenation. To do this, perform two conversions: first to an integer and then to a string 3 | 4 | ```text 5 | 2 times 6 | ``` 7 | -------------------------------------------------------------------------------- /modules/45-logic/15-bool-strings/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Напишите функцию `is_long_word()`, которая возвращает `True`, если длина переданного слова больше 5 символов, и `False` в противном случае. 2 | 3 | Пример работы: 4 | 5 | ```python 6 | print(is_long_word("apple")) # => False 7 | print(is_long_word("banana")) # => True 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.multiply_numbers_from_range(2, 2) == 2 6 | assert index.multiply_numbers_from_range(1, 3) == 6 7 | assert index.multiply_numbers_from_range(1, 5) == 120 8 | assert index.multiply_numbers_from_range(6, 6) == 6 9 | -------------------------------------------------------------------------------- /modules/50-loops/23-aggregation-strings/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function called `join_numbers_from_range()` that combines all the numbers from a range into a string: 3 | 4 | ```python 5 | join_numbers_from_range(1, 1) # '1' 6 | join_numbers_from_range(2, 3) # '23' 7 | join_numbers_from_range(5, 10) # '5678910' 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/30-variables/10-definition/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: What is a variable 3 | tips: 4 | - > 5 | [Naming in 6 | Programming](https://hexlet.io/blog/posts/code-complete-naming-in-programming) 7 | definitions: 8 | - name: Variable 9 | description: a way to save information and name it for later use in code. 10 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | The function from the theory is case-sensitive. I.e., `A' and `a' are different characters from its point of view. Write a version of this function that isn't case-sensitive: 3 | 4 | ```python 5 | count_chars('HexlEt', 'e') # 2 6 | count_chars('HexlEt', 'E') # 2 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/50-loops/70-for/test_code.py: -------------------------------------------------------------------------------- 1 | from index import filter_string 2 | 3 | 4 | def test(): 5 | text = "If I look forward I am win" 6 | assert filter_string(text, "z") == "If I look forward I am win" 7 | assert filter_string(text, "I") == "f look forward am wn" 8 | assert filter_string("zz zorro", "z") == " orro" 9 | -------------------------------------------------------------------------------- /modules/20-arithmetics/27-commutativity/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Напишите программу, которая выполняет два вычисления и выводит результаты на экран (каждый — в отдельной строке): 2 | 3 | 1. Число 3, возведённое в 5-ю степень. 4 | 1. Число -8, разделённое на -4. 5 | 6 | Для этого используйте оператор возведения в степень `**` и оператор деления `/`. 7 | -------------------------------------------------------------------------------- /modules/25-strings/15-escape-characters/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Escape sequences 3 | definitions: 4 | - name: Escape sequence 5 | description: >- 6 | a special combination of characters in text. For example, \n — is a line 7 | feed. 8 | tips: 9 | - '[Line feed history](https://en.wikipedia.org/wiki/Newline)' 10 | -------------------------------------------------------------------------------- /modules/25-strings/15-escape-characters/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Напишите программу, которая выводит на экран: 3 | 4 | ```text 5 | - Did Joffrey agree? 6 | - He did. He also said "I love using \n". 7 | ``` 8 | 9 | При этом программа использует только один `print()`, но результат на экране должен выглядеть в точности, как показано выше. 10 | -------------------------------------------------------------------------------- /modules/45-logic/28-logical-negation/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Отрицание 3 | tips: 4 | - | 5 | [Законы Де Моргана](https://ru.wikipedia.org/wiki/Законы_де_Моргана) 6 | definitions: 7 | - name: Отрицание 8 | description: > 9 | логическая операция, которая меняет логическое значение на 10 | противоположное. 11 | -------------------------------------------------------------------------------- /modules/50-loops/30-syntactic-sugar/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | text = "If I look back I am lost" 6 | assert index.filter_string(text, "w") == "If I look back I am lost" 7 | assert index.filter_string(text, "I") == "f look back am lost" 8 | assert index.filter_string("zz zorro", "z") == " orro" 9 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Constantes 3 | tips: [] 4 | definitions: 5 | - name: Constante 6 | description: >- 7 | una forma de almacenar información y darle un nombre para su uso posterior 8 | en el código; las constantes no se pueden modificar, a diferencia de las 9 | variables. 10 | -------------------------------------------------------------------------------- /modules/45-logic/10-bool-type/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Напишите функцию `is_pensioner()`, которая принимает возраст в качестве единственного аргумента и проверяет, является ли этот возраст пенсионным. Пенсионным считается возраст 60 лет и больше. 2 | 3 | Примеры вызова: 4 | 5 | ```python 6 | is_pensioner(75) # True 7 | is_pensioner(18) # False 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/50-loops/30-syntactic-sugar/index.py: -------------------------------------------------------------------------------- 1 | def filter_string(text: str, char: str) -> str: 2 | index = 0 3 | result = "" 4 | while index < len(text): 5 | current_char = text[index] 6 | if current_char != char: 7 | result = f"{result}{current_char}" 8 | index += 1 9 | return result 10 | -------------------------------------------------------------------------------- /modules/30-variables/18-variable-concatenation/index.py: -------------------------------------------------------------------------------- 1 | info = "We couldn't verify your mother's maiden name." 2 | intro = "Here is important information about your account security." 3 | 4 | first_name = "Joffrey" 5 | greeting = "Hello" 6 | 7 | # BEGIN 8 | print(greeting + ", " + first_name + "!") 9 | print(intro + "\n" + info) 10 | # END 11 | -------------------------------------------------------------------------------- /modules/45-logic/10-bool-type/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Escriba una función `is_pensioner()` que tome la edad como único argumento y verifique si esa edad corresponde a la jubilación. Se considera jubilación a partir de los 60 años. 3 | 4 | Ejemplos de llamadas: 5 | 6 | ```python 7 | is_pensioner(75) # True 8 | is_pensioner(18) # False 9 | ``` 10 | -------------------------------------------------------------------------------- /modules/45-logic/90-logical-expressions/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.string_or_not("Hexlet") == "yes" 6 | assert index.string_or_not(10) == "no" 7 | assert index.string_or_not("") == "yes" 8 | assert index.string_or_not(False) == "no" 9 | assert index.string_or_not(True) == "no" 10 | -------------------------------------------------------------------------------- /modules/20-arithmetics/20-basic/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Arithmetic operations 3 | tips: 4 | - > 5 | Always indent arithmetic operators with spaces between the numbers 6 | (operands) – it's good form when programming. Therefore, in our examples, we 7 | have `print(3 + 4)` rather than `print(3+4)`. 8 | - Division by zero generates an error. 9 | -------------------------------------------------------------------------------- /modules/25-strings/30-encoding/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Codificación 3 | tips: 4 | - | 5 | [¿Qué son las codificaciones?](https://codica.la/guides/encoding) 6 | definitions: 7 | - name: Codificación 8 | description: >- 9 | conjunto de caracteres codificados con números para representar texto en 10 | formato electrónico. 11 | -------------------------------------------------------------------------------- /modules/45-logic/28-logical-negation/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert not index.is_not_palindrome("wow") 6 | assert index.is_not_palindrome("hexlet") 7 | assert not index.is_not_palindrome("asdffdsa") 8 | assert not index.is_not_palindrome("Wow") 9 | assert index.is_not_palindrome("CodeBasics") 10 | -------------------------------------------------------------------------------- /modules/48-conditionals/65-match/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.get_number_explanation(0) == "just a number" 6 | assert index.get_number_explanation(666) == "devil number" 7 | assert index.get_number_explanation(42) == "answer for everything" 8 | assert index.get_number_explanation(7) == "prime number" 9 | -------------------------------------------------------------------------------- /modules/50-loops/10-while/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | from hexlet.test import expect_output 3 | 4 | 5 | def test1(capsys): 6 | index.print_reversed_numbers(2) 7 | expect_output(capsys, "2\n1\nfinished!") 8 | 9 | 10 | def test2(capsys): 11 | index.print_reversed_numbers(4) 12 | expect_output(capsys, "4\n3\n2\n1\nfinished!") 13 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Agregación de datos (Números) 3 | tips: 4 | - | 5 | [Iteración](https://es.wikipedia.org/wiki/Iteración) 6 | definitions: 7 | - name: Agregación 8 | description: >- 9 | Acumulación del resultado durante las iteraciones y trabajo con él después 10 | del bucle. 11 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # VCS 2 | .git 3 | 4 | # Python caches 5 | __pycache__ 6 | **/__pycache__ 7 | *.pyc 8 | *.pyo 9 | *.pyd 10 | 11 | # Virtual envs 12 | .venv 13 | venv/ 14 | ENV/ 15 | 16 | # Tool caches 17 | .ruff_cache 18 | .pytest_cache 19 | .mypy_cache 20 | 21 | # Editors/IDE 22 | .vscode 23 | .idea 24 | 25 | # OS junk 26 | .DS_Store 27 | Thumbs.db 28 | -------------------------------------------------------------------------------- /modules/20-arithmetics/43-float/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Числа с плавающей точкой 3 | tips: 4 | - > 5 | [Что нужно знать про арифметику с плавающей 6 | запятой](https://habr.com/ru/articles/112953/) 7 | definitions: 8 | - name: Рациональное число 9 | description: | 10 | число, которое можно представить в виде обыкновенной дроби. 11 | -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Write a program that prints: 3 | 4 | ```text 5 | "Khal Drogo's favorite word is "athjahakar"" 6 | ``` 7 | 8 | The program should display this exact phrase on the screen. Note the quotes at the beginning and the end of the phrase: 9 | 10 | ```text 11 | "Khal Drogo's favorite word is "athjahakar"" 12 | ``` 13 | -------------------------------------------------------------------------------- /modules/30-variables/15-variables-expressions/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Выражения в определениях 3 | tips: 4 | - | 5 | [Выражение](https://ru.wikipedia.org/wiki/Выражение_(информатика)) 6 | definitions: 7 | - name: Переменная 8 | description: >- 9 | способ сохранить информацию и дать ей имя для последующего использования в 10 | коде. 11 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Write the text below into the `text` variable. Use triple quotes. 3 | 4 | ```text 5 | Lannister, Targaryen, Baratheon, Stark, Tyrell... 6 | they're all just spokes on a wheel. 7 | This one's on top, then that one's on top, and on and on it spins, 8 | crushing those on the ground. 9 | ``` 10 | -------------------------------------------------------------------------------- /modules/48-conditionals/65-match/index.py: -------------------------------------------------------------------------------- 1 | def get_number_explanation(number: int) -> str: 2 | match number: 3 | case 666: 4 | return "devil number" 5 | case 7: 6 | return "prime number" 7 | case 42: 8 | return "answer for everything" 9 | case _: 10 | return "just a number" 11 | -------------------------------------------------------------------------------- /modules/50-loops/23-aggregation-strings/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Agregación de datos (Cadenas) 3 | tips: 4 | - | 5 | [Iteración](https://es.wikipedia.org/wiki/Iteraci%C3%B3n) 6 | definitions: 7 | - name: Agregación 8 | description: >- 9 | Acumulación de resultados durante las iteraciones y manejo de estos 10 | después del bucle. 11 | -------------------------------------------------------------------------------- /modules/25-strings/20-string-concatenation/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Конкатенация 3 | tips: 4 | - > 5 | Если в редакторе есть запись `# BEGIN` и `# END`, то код нужно писать между 6 | этими строчками. 7 | definitions: 8 | - name: Конкатенация 9 | description: | 10 | операция соединения двух строк. Например, `print("King's " + ' Landing')` 11 | -------------------------------------------------------------------------------- /modules/30-variables/10-definition/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: ¿Qué es una variable? 3 | tips: 4 | - | 5 | [Nomenclatura en programación](https://codica.la/blog/naming-in-programming) 6 | definitions: 7 | - name: Variable 8 | description: >- 9 | una forma de almacenar información y darle un nombre para su uso posterior 10 | en el código. 11 | -------------------------------------------------------------------------------- /modules/45-logic/10-bool-type/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Логический тип 3 | tips: 4 | - > 5 | [Boolean в 6 | Python](https://docs.python.org/3/library/stdtypes.html#boolean-values) 7 | definitions: 8 | - name: Логический тип (bool) 9 | description: >- 10 | тип данных с двумя возможными значениями: `True` (истина) и `False` 11 | (ложь). 12 | -------------------------------------------------------------------------------- /modules/45-logic/20-logic-combine-expressions/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Реализуйте функцию `is_international_phone()`, которая принимает на вход строку - номер телефона и проверяет его формат. Если телефон начинается с *+*, значит это международный формат. 2 | 3 | ```python 4 | is_international_phone('89602223423') # False 5 | is_international_phone('+79602223423') # True 6 | ``` 7 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Реализуйте функцию `guess_number()`, которая принимает число и проверяет, равно ли число заданному (пусть это будет 42). Если равно, то функция должна вернуть строку `'You win!'`, в противном случае нужно вернуть строку `'Try again!'`. 2 | 3 | ```python 4 | guess_number(42) # You win! 5 | guess_number(61) # Try again! 6 | ``` 7 | -------------------------------------------------------------------------------- /modules/50-loops/26-conditions-inside-loops/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | La función de la teoría tiene en cuenta el caso de las letras. Es decir, `A` y `a` son considerados caracteres diferentes. Implementa una versión de esta misma función en la que no importe el caso de las letras: 3 | 4 | ```python 5 | count_chars('HexlEt', 'e') # 2 6 | count_chars('HexlEt', 'E') # 2 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/30-variables/12-change/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | В упражнении определена переменная, внутри которой содержится строка. Переопределите значение этой переменной и присвойте ей строку, в которой расположите символы первоначальной строки в обратном порядке. Пример: 2 | 3 | ```python 4 | some_var = 'message' 5 | # Записываем message в обратном порядке 6 | some_var = 'egassem' 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/30-variables/15-variables-expressions/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Expresiones en definiciones 3 | tips: 4 | - | 5 | [Expresión](https://es.wikipedia.org/wiki/Expresión_(informática)) 6 | definitions: 7 | - name: Variable 8 | description: >- 9 | una forma de almacenar información y darle un nombre para su posterior uso 10 | en el código. 11 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Asigna el siguiente texto a la variable `text` utilizando triples comillas. 3 | 4 | ```text 5 | Lannister, Targaryen, Baratheon, Stark, Tyrell... 6 | they're all just spokes on a wheel. 7 | This one's on top, then that one's on top, and on and on it spins, 8 | crushing those on the ground. 9 | ``` 10 | -------------------------------------------------------------------------------- /modules/33-data-types/description.en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Data types 4 | description: 5 | Python is a language with strong typing and immutable primitive data types. What happens when we try to multiply a number by a string? How does Python know what type of data is in front of it? What is type conversion? You will find the answers to these questions in the current module. 6 | -------------------------------------------------------------------------------- /modules/33-data-types/description.ru.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Типы данных 4 | description: 5 | Python – язык с сильной типизацией и неизменяемыми примитивными типами данных. Что произойдет, если мы попробуем умножить число на строку? Каким образом Python понимает, что за тип данных перед ним? Что такое преобразование типов? Ответы на эти вопросы вы найдете в текущем модуле. 6 | -------------------------------------------------------------------------------- /modules/45-logic/10-bool-type/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Tipo lógico 3 | tips: 4 | - > 5 | [Booleanos en 6 | Python](https://docs.python.org/3/library/stdtypes.html#boolean-values) 7 | definitions: 8 | - name: Tipo lógico (bool) 9 | description: >- 10 | un tipo de dato con dos posibles valores: `True` (verdadero) y `False` 11 | (falso). 12 | -------------------------------------------------------------------------------- /modules/25-strings/10-quotes/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Escribe un programa que imprima en la pantalla: 3 | 4 | ```text 5 | "Khal Drogo's favorite word is "athjahakar"" 6 | ``` 7 | 8 | El programa debe imprimir exactamente esa frase. Presta atención a las comillas al principio y al final de la frase: 9 | 10 | ```text 11 | "Khal Drogo's favorite word is "athjahakar"" 12 | ``` 13 | -------------------------------------------------------------------------------- /modules/30-variables/13-variables-naming/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Choosing a variable's name 3 | tips: 4 | - > 5 | [Naming in 6 | Programming](https://hexlet.io/blog/posts/code-complete-naming-in-programming) 7 | - > 8 | [Naming Mistakes to Avoid in Programming 9 | I](https://hexlet.io/blog/posts/perfect-code-naming-mistakes-to-avoid-in-programming-i) 10 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/70-slices/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Срезы строк 3 | tips: 4 | - > 5 | [Подробнее о срезах в 6 | Python](https://www.w3schools.com/python/python_strings_slicing.asp) 7 | definitions: 8 | - name: Срезы для строк 9 | description: >- 10 | механизм, с помощью которого извлекается подстрока по указанным 11 | параметрам. 12 | -------------------------------------------------------------------------------- /modules/45-logic/20-logic-combine-expressions/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function called `is_international_phone()` function that checks the format of a given phone number. If the phone number starts with *+*, then it's in the international format. 3 | 4 | ```python 5 | is_international_phone('89602223423') # False 6 | is_international_phone('+79602223423') # True 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa la función `guess_number()`, que toma un número y verifica si es igual al número dado (supongamos que es 42). Si es igual, la función debe devolver la cadena `'You win!'`, de lo contrario, debe devolver la cadena `'Try again!'`. 3 | 4 | ```python 5 | guess_number(42) # You win! 6 | guess_number(61) # Try again! 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/50-loops/55-return-from-loops/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Vuelta desde bucles 3 | tips: 4 | - >- 5 | [Lista de números 6 | primos](https://es.wikipedia.org/wiki/Anexo:Números_primos) 7 | definitions: 8 | - name: Agregación 9 | description: >- 10 | Acumular resultados durante las iteraciones y trabajar con ellos después 11 | del bucle. 12 | -------------------------------------------------------------------------------- /modules/35-calling-functions/180-variadic-parameters/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Функции с переменным числом параметров 3 | tips: 4 | - > 5 | [Пример функции с переменным числом 6 | параметров](https://docs.python.org/3/library/functions.html?highlight=pow#max) 7 | definitions: 8 | - name: Аргумент по умолчанию 9 | description: необязательный аргумент функции. 10 | -------------------------------------------------------------------------------- /modules/40-define-functions/400-default-parameters/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Parámetros opcionales de las funciones 3 | tips: 4 | - > 5 | [Parámetros por 6 | defecto](https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Functions/Default_parameters) 7 | definitions: 8 | - name: Parámetro por defecto 9 | description: parámetro opcional de una función 10 | -------------------------------------------------------------------------------- /modules/40-define-functions/500-named-arguments/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test(): 5 | assert index.trim_and_repeat("python") == "python" 6 | assert index.trim_and_repeat("python", offset=4) == "on" 7 | assert index.trim_and_repeat("python", repetitions=2) == "pythonpython" 8 | assert index.trim_and_repeat("python", offset=4, repetitions=2) == "onon" 9 | -------------------------------------------------------------------------------- /modules/45-logic/10-bool-type/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Write a function `is_pensioner()` that takes someone's age as a single argument and checks whether that person is at retirement age. For the purposes of this exercise, retirement age is considered to be 60 years or over. 3 | 4 | Call examples: 5 | 6 | ```python 7 | is_pensioner(75) # True 8 | is_pensioner(18) # False 9 | ``` 10 | -------------------------------------------------------------------------------- /modules/45-logic/20-logic-combine-expressions/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa la función `is_international_phone()`, que verifica el formato de un número de teléfono especificado. Si el teléfono comienza con un `+`, significa que está en formato internacional. 3 | 4 | ```python 5 | is_international_phone('89602223423') # False 6 | is_international_phone('+79602223423') # True 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/45-logic/20-logic-combine-expressions/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Combinación de operaciones y funciones 3 | tips: 4 | - | 5 | [Expresión](https://es.wikipedia.org/wiki/Expresión_(informática)) 6 | definitions: 7 | - name: Expresión 8 | description: > 9 | una secuencia de acciones sobre datos que produce un resultado que se 10 | puede utilizar. 11 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Интерполяция 3 | tips: 4 | - > 5 | [f-строки](https://docs.python.org/3/tutorial/inputoutput.html#fancier-output-formatting) 6 | definitions: 7 | - name: Интерполяция 8 | description: >- 9 | способ получения сложной строки из нескольких простых с использованием 10 | специальных шаблонов 11 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function called `multiply_numbers_from_range()` that multiplies numbers in a specified range, including range boundaries. Call example: 3 | 4 | ```python 5 | multiply_numbers_from_range(1, 5) # 1 * 2 * 3 * 4 * 5 = 120 6 | multiply_numbers_from_range(2, 3) # 2 * 3 = 6 7 | multiply_numbers_from_range(6, 6) # 6 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/10-basics/20-comments/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Комментарии 3 | tips: 4 | - > 5 | [Подробнее о 6 | комментариях](https://www.w3schools.com/python/python_comments.asp) 7 | definitions: 8 | - name: Комментарий 9 | description: > 10 | текст в коде программы, который не влияет на функциональность и 11 | добавляется программистами для себя и своих коллег. 12 | -------------------------------------------------------------------------------- /modules/10-basics/50-syntax-errors/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Syntax errors 3 | tips: [] 4 | definitions: 5 | - name: Syntax errors 6 | description: violation of the grammatical rules of the programming language. 7 | - name: SyntaxError (parsing error) 8 | description: >- 9 | the type of errors in Python that occur when there are syntax errors in 10 | the code. 11 | -------------------------------------------------------------------------------- /modules/25-strings/20-string-concatenation/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Concatenación 3 | tips: 4 | - > 5 | Si hay una línea `# BEGIN` y `# END` en el editor, el código debe escribirse 6 | entre esas líneas. 7 | definitions: 8 | - name: Concatenación 9 | description: > 10 | operación que une dos cadenas de texto. Por ejemplo, `print("King's " + ' 11 | Landing')` 12 | -------------------------------------------------------------------------------- /modules/30-variables/19-naming-style/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Create two variables named «first number» and «second number» in English using snake_case. Write `20` into the first variable and `-100` into the second variable. Print the product of the numbers written in the resulting variables. 3 | 4 | The code will work with any name, and we only check the printed result, so the task is up to you. 5 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Запишите в переменную `text` текст, который приведен ниже. В результате должны сохраниться все переносы строк. 2 | 3 | ```text 4 | Lannister, Targaryen, Baratheon, Stark, Tyrell... 5 | they're all just spokes on a wheel. 6 | This one's on top, then that one's on top, and on and on it spins, 7 | crushing those on the ground. 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Usando el corte de cadenas, obtén una parte de la oración almacenada en la variable `text`, desde el carácter `5` hasta el carácter `15`, inclusive. Luego, procesa la subcadena obtenida con el método `.strip()` y muestra en pantalla la longitud de la subcadena resultante. Realiza estas operaciones en cadena sin crear variables intermedias. 3 | -------------------------------------------------------------------------------- /modules/45-logic/20-logic-combine-expressions/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Комбинирование операций и функций 3 | tips: 4 | - | 5 | [Выражение](https://ru.wikipedia.org/wiki/Выражение_(информатика)) 6 | definitions: 7 | - name: Выражение 8 | description: > 9 | последовательность действий над данными, приводящая к каком-то результату, 10 | который можно использовать. 11 | -------------------------------------------------------------------------------- /modules/48-conditionals/30-if/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function called `guess_number()` that takes a number and checks if the number is equal to a given number (let's say 42). If it's equal, the function should return the string `'You win!'`, otherwise it should return the string `'Try again!'`. 3 | 4 | ```python 5 | guess_number(42) # You win! 6 | guess_number(61) # Try again! 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/20-arithmetics/43-float/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Números de punto flotante 3 | tips: 4 | - > 5 | [Qué debes saber sobre los números o constantes de punto 6 | flotante](https://academia-lab.com/enciclopedia/aritmetica-de-punto-flotante/) 7 | definitions: 8 | - name: Número racional 9 | description: | 10 | número que se puede representar como una fracción común. 11 | -------------------------------------------------------------------------------- /modules/30-variables/19-naming-style/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 1. Создайте две переменные с именами «первое число» и «второе число» на английском языке используя snake_case. То как вы назовете переменные не принципиально, тесты это не проверяют. 2 | 1. Запишите в первую переменную число `20`, во вторую — `-100`. 3 | 1. Вычислите произведение значений этих переменных. 4 | 1. Выведите получившееся число на экран. 5 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/90-multiline-strings/test_code.py: -------------------------------------------------------------------------------- 1 | from hexlet.test import expect_output 2 | 3 | 4 | def test(capsys): 5 | expected = """Lannister, Targaryen, Baratheon, Stark, Tyrell... 6 | they're all just spokes on a wheel. 7 | This one's on top, then that one's on top, and on and on it spins, 8 | crushing those on the ground.""" 9 | expect_output(capsys, expected) 10 | -------------------------------------------------------------------------------- /modules/35-calling-functions/180-variadic-parameters/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Funciones con número variable de parámetros 3 | tips: 4 | - > 5 | [Ejemplo de función con número variable de 6 | parámetros](https://docs.python.org/3/library/functions.html?highlight=pow#max) 7 | definitions: 8 | - name: Argumento por defecto 9 | description: argumento opcional de una función. 10 | -------------------------------------------------------------------------------- /modules/25-strings/description.en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Strings 4 | description: 5 | Text in programming is called "strings," and this topic is not as simple as it may seem. How do you output a phrase that has both single and double quotes? What is an escape sequence? The module focuses on different aspects of writing text - we'll experiment with the output of different strings and talk about encoding. 6 | -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Imprime en la pantalla la cadena de texto `2 times`, obtenida a partir del número 2.9 (almacenado en la variable `value`) y la cadena de texto `times`, utilizando conversiones de tipos y concatenación. Para lograrlo, debes realizar dos conversiones: primero a un número entero y luego a una cadena de texto. 3 | 4 | ```text 5 | 2 times 6 | ``` 7 | -------------------------------------------------------------------------------- /modules/33-data-types/description.es.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Tipos de datos 4 | description: 5 | Python es un lenguaje con una tipificación sólida y tipos de datos primitivos e inmutables. ¿Qué sucede si intentamos multiplicar un número por una cadena? ¿Cómo Python entiende qué tipo de dato tiene ante sí? ¿Qué es la conversión de tipos? Encontrarás las respuestas a estas preguntas en el módulo actual. 6 | -------------------------------------------------------------------------------- /modules/35-calling-functions/150-calling-functions-expression/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Display the first and last letters of the sentence written in the `text` variable in the following format: 3 | 4 | ```text 5 | First: N 6 | Last: t 7 | ``` 8 | 9 | Try to create only one variable to be assigned to the text to before you print it. In this lesson, we're practicing building a compound expression. 10 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa la función `multiply_numbers_from_range()`, que multiplica los números en el rango especificado, incluyendo los límites del rango. Ejemplo de llamada: 3 | 4 | ```python 5 | multiply_numbers_from_range(1, 5) # 1 * 2 * 3 * 4 * 5 = 120 6 | multiply_numbers_from_range(2, 3) # 2 * 3 = 6 7 | multiply_numbers_from_range(6, 6) # 6 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/50-loops/20-aggregation-numbers/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Реализуйте функцию `multiply_numbers_from_range()`, которая принимает два числа, границы диапазона, и перемножает числа в нем, включая границы диапазона. Пример вызова: 2 | 3 | ```python 4 | multiply_numbers_from_range(1, 5) # 1 * 2 * 3 * 4 * 5 = 120 5 | multiply_numbers_from_range(2, 3) # 2 * 3 = 6 6 | multiply_numbers_from_range(6, 6) # 6 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/25-strings/15-escape-characters/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Secuencias de escape 3 | definitions: 4 | - name: Secuencia de escape 5 | description: >- 6 | una combinación especial de caracteres en un texto. Por ejemplo, \n es un 7 | salto de línea. 8 | tips: 9 | - >- 10 | [Historia del salto de 11 | línea](https://es.wikipedia.org/wiki/Salto_de_l%C3%ADnea#Historia) 12 | -------------------------------------------------------------------------------- /modules/25-strings/15-escape-characters/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Экранированные последовательности 3 | definitions: 4 | - name: Экранированная последовательность 5 | description: >- 6 | специальная комбинация символов в тексте. Например, \n — это перевод 7 | строки. 8 | tips: 9 | - >- 10 | [История перевода 11 | строки](https://ru.wikipedia.org/wiki/Перевод_строки#История) 12 | -------------------------------------------------------------------------------- /modules/25-strings/description.ru.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Строки 4 | description: 5 | Текст в программировании называется «строками», и эта тема не так проста, как может показаться. Как вывести фразу, в которой есть и одинарные, и двойные кавычки? Что такое экранированная последовательность? Модуль посвящен разным аспектам написания текста – мы поэкспериментируем с выводом разных строк и поговорим о кодировке. 6 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/25-interpolation/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Interpolación 3 | tips: 4 | - > 5 | [f-strings](https://docs.python.org/3/tutorial/inputoutput.html#fancier-output-formatting) 6 | definitions: 7 | - name: Interpolación 8 | description: >- 9 | una forma de obtener una cadena compleja a partir de varias cadenas 10 | simples utilizando plantillas especiales. 11 | -------------------------------------------------------------------------------- /modules/50-loops/10-while/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Напишите функцию `print_reversed_numbers()`. Функция должна принимать число и выводить числа в обратном порядке от этого числа до нуля (нуль не выводится). 2 | 3 | По окончании работы функция должна вывести на экран строку `finished!`. 4 | 5 | ```python 6 | print_reversed_numbers(4) 7 | # => 4 8 | # => 3 9 | # => 2 10 | # => 1 11 | # => finished! 12 | ``` 13 | -------------------------------------------------------------------------------- /modules/50-loops/80-for-in-range/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Implement the `print_table_of_squares(from, to)` function that prints squares of numbers to the screen. It first `from` and last `to` a number prints the string `square of is ` 2 | 3 | Call examples: 4 | 5 | ```python 6 | print_table_of_squares(1, 3) 7 | # => square of 1 is 1 8 | # => square of 2 is 4 9 | # => square of 3 is 9 10 | ``` 11 | -------------------------------------------------------------------------------- /modules/25-strings/30-encoding/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Кодировка 3 | tips: 4 | - | 5 | [Таблица ASCII кодов](https://www.ascii-code.com/) 6 | - | 7 | [Что такое кодировки?](https://ru.hexlet.io/blog/posts/encoding) 8 | definitions: 9 | - name: Кодировка 10 | description: >- 11 | набор символов, закодированных с помощью чисел для представления текста в 12 | электронном виде. 13 | -------------------------------------------------------------------------------- /modules/31-advanced-strings/70-slices/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Recortes de cadenas 3 | tips: 4 | - > 5 | [Más información sobre recortes en 6 | Python](https://www.w3schools.com/python/python_strings_slicing.asp) 7 | definitions: 8 | - name: Recortes de cadenas 9 | description: >- 10 | mecanismo mediante el cual se extrae una subcadena según los parámetros 11 | especificados. 12 | -------------------------------------------------------------------------------- /modules/35-calling-functions/150-calling-functions-expression/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Выведите на экран первую и последнюю буквы предложения, записанного в переменную `text`, в следующем формате: 2 | 3 | ```text 4 | First: N 5 | Last: t 6 | ``` 7 | 8 | Постарайтесь создать только одну переменную, в которую сразу запишется нужный текст перед печатью на экран. В этом уроке мы отрабатываем умение собирать составное выражение. 9 | -------------------------------------------------------------------------------- /modules/10-basics/40-testing/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: How we check your solutions 3 | definitions: 4 | - name: Tests 5 | description: >- 6 | a special code that checks programs for correctness by comparing the 7 | result obtained during the execution of the program with the expected 8 | result. 9 | tips: 10 | - | 11 | [TDD](https://en.wikipedia.org/wiki/Test-driven_development) 12 | -------------------------------------------------------------------------------- /modules/50-loops/25-iteration-over-string/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function called `print_reversed_word_by_symbol()` that prints a word passed to it character by character, as in the example from the theory, but in reverse order. 3 | 4 | ```python 5 | word = 'Hexlet' 6 | 7 | print_reversed_word_by_symbol(word) 8 | # => 't' 9 | # => 'e' 10 | # => 'l' 11 | # => 'x' 12 | # => 'e' 13 | # => 'H' 14 | ``` 15 | -------------------------------------------------------------------------------- /modules/20-arithmetics/27-commutativity/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Commutative operation 3 | tips: [] 4 | definitions: 5 | - name: Commutativity 6 | description: > 7 | the property of an operation where changing the order of operands does not 8 | affect the result. For example, addition is a commutative operation: 9 | changing the order of the numbers we are adding doesn't change the result. 10 | -------------------------------------------------------------------------------- /modules/33-data-types/55-data-types-casting/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | У вас есть число с плавающей точкой: 2 | 3 | ```python 4 | value = 2.9 5 | ``` 6 | 7 | Напишите программу, которая: 8 | 9 | 1. Преобразует его в целое число. 10 | 1. Полученное число превратит в строку. 11 | 1. Выведите эту строку на экран, добавив (используя конкатенацию) к ней слово `times` через пробел. 12 | 13 | Используйте функции `int()` и `str()`. 14 | -------------------------------------------------------------------------------- /modules/35-calling-functions/270-deterministic/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Determinismo 3 | tips: 4 | - | 5 | [Funciones deterministas](https://en.wikipedia.org/wiki/Pure_function) 6 | definitions: 7 | - name: Efecto secundario 8 | description: >- 9 | una acción que modifica el entorno externo (el entorno de ejecución). Por 10 | ejemplo, la impresión en pantalla o el envío de un correo electrónico. 11 | -------------------------------------------------------------------------------- /modules/50-loops/30-syntactic-sugar/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Синтаксический сахар 3 | tips: 4 | - | 5 | [Синтаксический сахар](https://ru.wikipedia.org/wiki/Синтаксический_сахар) 6 | definitions: 7 | - name: Синтаксический сахар 8 | description: > 9 | это синтаксические возможности, применение которых не влияет на поведение 10 | программы, но делает использование языка более удобным для человека. 11 | -------------------------------------------------------------------------------- /modules/50-loops/55-return-from-loops/test_code.py: -------------------------------------------------------------------------------- 1 | from index import is_contains_char 2 | 3 | 4 | def test_is_contains_char(): 5 | assert is_contains_char("Hexlet", "H") is True 6 | assert is_contains_char("Hexlet", "h") is False 7 | assert is_contains_char("Awesomeness", "m") is True 8 | assert is_contains_char("Awesomeness", "d") is False 9 | assert is_contains_char("Awesomeness", "o") is True 10 | -------------------------------------------------------------------------------- /.github/workflows/Docker.yml: -------------------------------------------------------------------------------- 1 | name: Docker 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | main: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: hexlet-basics/exercises-action@release 17 | with: 18 | DOCKER_USERNAME: ${{ github.actor }} 19 | DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} 20 | -------------------------------------------------------------------------------- /modules/30-variables/18-variable-concatenation/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Variables and concatenation 3 | tips: 4 | - > 5 | Consider how you should concatenate the variables to get the two-line output 6 | of the email body. 7 | - > 8 | Remember that you can create a string that contains only the control 9 | sequence `\n`. You can concatenate this string with variables to get proper 10 | text formatting. 11 | -------------------------------------------------------------------------------- /modules/40-define-functions/600-type-annotations/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function, `word_multiply()`. It should accept two parameters: 3 | 4 | * A word 5 | * A number representing how many times to repeat the word 6 | 7 | ```python 8 | text = 'python' 9 | print(word_multiply(text, 2)) # => pythonpython 10 | print(word_multiply(text, 0)) # => 11 | ``` 12 | 13 | Specify type annotations when declaring a function. 14 | -------------------------------------------------------------------------------- /modules/50-loops/25-iteration-over-string/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa la función `print_reversed_word_by_symbol()`, que imprime la palabra pasada como argumento carácter por carácter, como se muestra en el ejemplo de la teoría, pero en orden inverso. 3 | 4 | ```python 5 | word = 'Hexlet' 6 | 7 | print_reversed_word_by_symbol(word) 8 | # => 't' 9 | # => 'e' 10 | # => 'l' 11 | # => 'x' 12 | # => 'e' 13 | # => 'H' 14 | ``` 15 | -------------------------------------------------------------------------------- /modules/30-variables/12-change/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | In the exercise, a variable is defined with a string inside it. Override the value of this variable and assign it a string in which the characters of the original string are arranged in reverse order. 3 | 4 | Note: in this assignment, you'll have to write code between lines with comments `# BEGIN` and `# END` (we mentioned it before, but this is the first time you've come across this format). 5 | -------------------------------------------------------------------------------- /modules/35-calling-functions/270-deterministic/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Детерминированность 3 | tips: 4 | - > 5 | [Детерминированные 6 | функции](https://ru.wikipedia.org/wiki/Чистота_функции#Детерминированность_функции) 7 | definitions: 8 | - name: Побочный эффект 9 | description: >- 10 | действие, которое изменяет внешнее окружение (среду выполнения). Например, 11 | вывод на экран или отправка письма. 12 | -------------------------------------------------------------------------------- /modules/38-objects/200-methods-immutability/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | User input data often contains extra spaces at the end or beginning of a string. They're usually cut out using a method [.strip()](https://docs.python.org/3/library/stdtypes.html), for example, it was ``hello\n'`` and now it's ``hello'``. 3 | 4 | Update the `first_name` variable by writing the same value to it, but this time processed by the `.strip()` method. Print the result. 5 | -------------------------------------------------------------------------------- /modules/50-loops/30-syntactic-sugar/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Azúcar sintáctico 3 | tips: 4 | - | 5 | [Azúcar sintáctico](https://es.wikipedia.org/wiki/Azúcar_sintáctico) 6 | definitions: 7 | - name: Azúcar sintáctico 8 | description: > 9 | son características sintácticas que no afectan el comportamiento en sí del 10 | programa, pero hacen que el uso del lenguaje sea más conveniente para los 11 | humanos. 12 | -------------------------------------------------------------------------------- /modules/10-basics/20-comments/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Comentarios 3 | tips: 4 | - > 5 | [Más información sobre 6 | comentarios](https://www.w3schools.com/python/python_comments.asp) 7 | definitions: 8 | - name: Comentario 9 | description: > 10 | se trata de un texto en el código de un programa que no afecta su 11 | funcionalidad y lo agregan los programadores para su propio uso y/o el de 12 | sus colegas. 13 | -------------------------------------------------------------------------------- /modules/30-variables/15-variables-expressions/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Напишите программу, которая берет исходное количество евро, записанное в переменную `euros_count`, переводит евро в доллары и выводит на экран. Затем полученное значение переводит в юани и выводит на новой строчке. 2 | 3 | Пример вывода для 100 евро: 4 | 5 | ```text 6 | 125.0 7 | 863.75 8 | ``` 9 | 10 | Считаем, что: 11 | - 1 евро = 1.25 долларов 12 | - 1 доллар = 6.91 юаней 13 | -------------------------------------------------------------------------------- /modules/45-logic/description.en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Logic 4 | description: | 5 | Logical expressions allow you to answer questions that arise while the program is running. Is the user authenticated? Is the subscription paid for? Is it a leap year? In this module, we will study functions-predicates - those that ask a question and answer it - true or false. We will practice writing such functions and move on to more complex logical expressions. 6 | -------------------------------------------------------------------------------- /modules/45-logic/description.ru.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Логика 4 | description: | 5 | Логические выражения позволяют отвечать на вопросы, которые возникают во время работы программы. Пользователь аутентифицирован? Подписка оплачена? Год високосный? В этом модуле изучаем функции-предикаты – те, которые задают вопрос и отвечают на него – правда это или ложь. Попрактикуемся в написании таких функций и перейдем к более сложным логическим выражениям. 6 | -------------------------------------------------------------------------------- /src/hexlet/test.py: -------------------------------------------------------------------------------- 1 | import importlib 2 | import types 3 | 4 | __all__ = ("expect_output",) 5 | 6 | 7 | def expect_output(capsys, expected): 8 | importlib.import_module("index") 9 | out, _err = capsys.readouterr() 10 | actual = out.strip() 11 | 12 | if isinstance(expected, types.FunctionType): 13 | expected(actual) 14 | else: 15 | assert actual == expected 16 | 17 | print("\n") 18 | print(out) 19 | -------------------------------------------------------------------------------- /modules/35-calling-functions/150-calling-functions-expression/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Imprime en pantalla la primera y la última letra de la oración almacenada en la variable `texto`, en el siguiente formato: 3 | 4 | ```text 5 | First: N 6 | Last: t 7 | ``` 8 | 9 | Intenta crear solo una variable en la que se almacene el texto necesario antes de imprimirlo en pantalla. En esta lección, estamos practicando cómo construir una expresión compuesta. 10 | -------------------------------------------------------------------------------- /modules/40-define-functions/600-type-annotations/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa la función `word_multiply()`. Debe aceptar dos parámetros: 3 | 4 | * Una cadena de texto 5 | * Un número que indica cuántas veces se debe repetir la cadena 6 | 7 | ```python 8 | text = 'python' 9 | print(word_multiply(text, 2)) # => pythonpython 10 | print(word_multiply(text, 0)) # => 11 | ``` 12 | 13 | Especifica las anotaciones de tipos al declarar la función. 14 | -------------------------------------------------------------------------------- /modules/30-variables/10-definition/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Что такое переменная 3 | tips: 4 | - > 5 | [Именование в 6 | программировании](https://ru.hexlet.io/blog/posts/naming-in-programming?utm_source=code-basics&utm_medium=referral&utm_campaign=blog&utm_content=lesson) 7 | definitions: 8 | - name: Переменная 9 | description: >- 10 | способ сохранить информацию и дать ей имя для последующего использования в 11 | коде. 12 | -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Функции и их вызов 3 | tips: [] 4 | definitions: 5 | - name: Функция 6 | description: >- 7 | операция, способная принимать данные и возвращать результат; функция 8 | вызывается так: `foo()`. 9 | - name: Аргумент 10 | description: >- 11 | информация, которую функция получает при вызове. Например, `foo(42)` — 12 | передача аргумента `42` функции `foo()` 13 | -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function named `print_motto()` that displays the phrase *Winter is coming*. 3 | 4 | ```python 5 | print_motto() # => Winter is coming 6 | ``` 7 | 8 | In tasks where you have to implement a function, you don't need to call it. Automated tests will call this function to check if it works. The example call above is shown just to give you an idea of how your function will be used. 9 | -------------------------------------------------------------------------------- /modules/48-conditionals/50-else-if/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test1(): 5 | assert index.who_is_this_house_to_starks("Tully") == "friend" 6 | assert index.who_is_this_house_to_starks("Karstark") == "friend" 7 | assert index.who_is_this_house_to_starks("Lannister") == "enemy" 8 | assert index.who_is_this_house_to_starks("Martell") == "neutral" 9 | assert index.who_is_this_house_to_starks("undefined") == "neutral" 10 | -------------------------------------------------------------------------------- /modules/50-loops/30-syntactic-sugar/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Реализуйте функцию `filter_string()`, принимающую на вход строку и символ, и возвращающую новую строку, в которой удален переданный символ во всех его позициях. Старайтесь не использовать встроенные методы работы со строкой в своем решении. 2 | 3 | ```python 4 | text = 'If I look back I am lost' 5 | filter_string(text, 'I') # 'f look back am lost' 6 | filter_string(text, 'o') # 'If I lk back I am lst' 7 | ``` 8 | -------------------------------------------------------------------------------- /modules/30-variables/12-change/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | En este ejercicio se define una variable que contiene una cadena de texto. Reasigne el valor de esta variable y asígnele una cadena de texto en la que los caracteres de la cadena original estén en orden inverso. 3 | 4 | Tenga en cuenta: en este ejercicio, deberá escribir código entre las líneas de comentarios `# BEGIN` y `# END` (esto se mencionó anteriormente, pero esta es la primera vez que se encuentra con este formato). 5 | -------------------------------------------------------------------------------- /modules/20-arithmetics/27-commutativity/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Коммутативная операция 3 | tips: 4 | - > 5 | [Подробнее про 6 | коммутативность](https://ru.wikipedia.org/wiki/Коммутативность) 7 | definitions: 8 | - name: Коммутативность 9 | description: > 10 | свойство операции, когда изменение порядка операндов не влияет на 11 | результат. Например, сложение — коммутативная операция: от перемены мест 12 | слагаемых сумма не меняется. 13 | -------------------------------------------------------------------------------- /modules/25-strings/description.es.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Cadenas 4 | description: | 5 | En programación, el texto se llama "cadenas" y este tema no es tan sencillo como puede parecer a simple vista. ¿Cómo mostrar una frase que contiene tanto comillas simples como comillas dobles? ¿Qué es una secuencia de escape? Este módulo se enfoca en los diferentes aspectos de la escritura de texto: experimentaremos con la impresión de diferentes cadenas y hablaremos sobre la codificación. 6 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Реализуйте функцию `flip_flop()`, которая принимает на вход строку и, если эта строка равна `'flip'`, возвращает строку `'flop'`. В противном случае функция должна вернуть `'flip'`. 2 | 3 | Примеры вызова: 4 | 5 | ```python 6 | print(flip_flop('flip')) # => 'flop' 7 | print(flip_flop('flop')) # => 'flip' 8 | ``` 9 | 10 | Попробуйте написать два варианта функции: с обычным if-else, и с тернарным оператором. 11 | -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Copy the exact code from the instructions into the editor and run it by clicking “Run”. 2 | 3 | ```python 4 | print('Hello, World!') 5 | ``` 6 | 7 | Note: if you write `heLLo, woRld!` instead of `Hello, World!`, it will be considered different text, because upper and lower case letters are different characters and different _registers_. In programming, the register almost always matters, so get used to always paying attention to it! 8 | -------------------------------------------------------------------------------- /modules/10-basics/40-testing/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Как мы проверяем ваши решения 3 | definitions: 4 | - name: Тесты 5 | description: >- 6 | специальный код, проверяющий программы на корректность путём сравнения 7 | полученного при выполнении программы результата с ожидаемым. 8 | tips: 9 | - | 10 | [TDD](https://ru.wikipedia.org/wiki/Разработка_через_тестирование) 11 | - | 12 | [Сообщество Хекслета в Telegram](https://t.me/hexletcommunity) 13 | -------------------------------------------------------------------------------- /modules/38-objects/200-methods-immutability/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Данные, вводимые пользователями, часто содержат лишние пробельные символы в конце или начале строки. Обычно их вырезают с помощью метода [.strip()](https://docs.python.org/3/library/stdtypes.html). Например, 3 | 4 | * Было: `' hello\n '` 5 | * Стало: `'hello'` 6 | 7 | Обновите переменную `first_name`, записав в неё то же самое значение, но обработанное методом `.strip()`. Распечатайте то, что получилось, на экран. 8 | -------------------------------------------------------------------------------- /modules/48-conditionals/description.ru.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Условные конструкции 4 | description: | 5 | Задача функции-предиката — получить ответ на вопрос, но обычно этого недостаточно и нужно выполнить определенное действие в зависимости от ответа. If и if-else  – конструкции Python, с помощью которых программист может выбирать необходимое поведение программы в зависимости от разных условий: пропускать одни инструкции и выполнять другие. Их и разберем на практике в этом модуле. 6 | -------------------------------------------------------------------------------- /modules/50-loops/30-syntactic-sugar/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa la función `filter_string()`, que recibe una cadena y un carácter, y devuelve una nueva cadena en la que se elimina el carácter pasado en todas sus posiciones. Intenta no utilizar métodos incorporados para trabajar con cadenas en tu solución. 3 | 4 | ```python 5 | text = 'If I look back I am lost' 6 | filter_string(text, 'I') # 'f look back am lost' 7 | filter_string(text, 'o') # 'If I lk back I am lst' 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/10-basics/50-syntax-errors/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Синтаксические ошибки 3 | tips: 4 | - > 5 | [Виды ошибок в 6 | Python](https://docs.python.org/3/library/exceptions.html#exception-hierarchy) 7 | definitions: 8 | - name: Синтаксическая ошибка 9 | description: нарушение грамматических правил языка программирования. 10 | - name: SyntaxError (ошибка парсинга) 11 | description: тип ошибок в Python, возникающих при наличии синтаксических ошибок в коде. 12 | -------------------------------------------------------------------------------- /modules/30-variables/15-variables-expressions/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Escribe un programa que tome una cantidad inicial de euros, almacenada en la variable `euros_count`, convierta los euros a dólares y los muestre en pantalla. Luego, convierte el valor obtenido a yuanes y lo muestra en una nueva línea. 3 | 4 | Ejemplo de salida para 100 euros: 5 | 6 | 7 | ```text 8 | 125.0 9 | 863.75 10 | ``` 11 | 12 | Supongamos que: 13 | - 1 euro = 1.25 dólares 14 | - 1 dólar = 6.91 yuanes 15 | -------------------------------------------------------------------------------- /modules/30-variables/19-naming-style/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Crea dos variables con los nombres "primer número" y "segundo número" en inglés utilizando snake_case. Asigna el número `20` a la primera variable y `-100` a la segunda. Imprime en pantalla el producto de los números almacenados en las variables resultantes. 3 | 4 | El código funcionará con cualquier nombre, y nuestro sistema siempre verifica solamente el resultado en pantalla, por lo que completar esta tarea es tu responsabilidad. 5 | -------------------------------------------------------------------------------- /modules/45-logic/description.es.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Lógica 4 | description: | 5 | Las expresiones lógicas permiten responder preguntas que surgen durante la ejecución del programa. ¿Está autenticado el usuario? ¿Se ha pagado la suscripción? ¿Es un año bisiesto? En este módulo, aprenderemos sobre las funciones booleanas, que plantean una pregunta y responden si es verdadera o falsa. Practicaremos la escritura de estas funciones y avanzaremos hacia expresiones lógicas más complejas. 6 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function `flip_flop()` that takes a string as input and, if that string is `'flip'`, returns the string `'flop'`. Otherwise, the function should return `'flip'`. 3 | 4 | Examples of calls: 5 | 6 | ```python 7 | print(flip_flop('flip')) # => 'flop' 8 | print(flip_flop('flop')) # => 'flip' 9 | ``` 10 | 11 | Try writing two versions of the function: with the usual if-else, and with the ternary operator. 12 | -------------------------------------------------------------------------------- /modules/50-loops/30-syntactic-sugar/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function called `filter_string()` that takes a string and a character as input, and returns a new string with the character removed from every point in the string. Try not to use the built-in methods for working with the string in your solution. 3 | 4 | ```python 5 | text = 'If I look back I am lost' 6 | filter_string(text, 'I') # 'f look back am lost' 7 | filter_string(text, 'o') # 'If I lk back I am lst' 8 | ``` 9 | -------------------------------------------------------------------------------- /modules/30-variables/15-variables-expressions/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Write a program that takes the original number of euros written in the variable `euros_count`, converts euros to dollars, and prints it to the screen. Then, it should convert the result to yuans and print it on a new line. 3 | 4 | Example output for 100 euros: 5 | 6 | ```text 7 | 125.0 8 | 863.75 9 | ``` 10 | 11 | For the purposes of the exercise, we'll say that: 12 | - 1 euro = $1.25 13 | - 1 dollar = 6.91 yuans 14 | -------------------------------------------------------------------------------- /modules/35-calling-functions/100-call/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Funciones y su ejecución 3 | tips: [] 4 | definitions: 5 | - name: Función 6 | description: >- 7 | operación que puede recibir datos y devolver un resultado; se llama a una 8 | función de esta manera: `foo()`. 9 | - name: Argumento 10 | description: >- 11 | información que una función recibe al ser ejecutada. Por ejemplo, 12 | `foo(42)` es pasar el argumento `42` a la función `foo()`. 13 | -------------------------------------------------------------------------------- /modules/30-variables/13-variables-naming/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Elección del nombre de la variable 3 | tips: 4 | - | 5 | [Nomenclatura en programación](https://codica.la/blog/naming-in-programming) 6 | - > 7 | [Errores en la nomenclatura de 8 | variables](https://codica.la/blog/naming-errors-1) 9 | definitions: 10 | - name: Variable 11 | description: >- 12 | una forma de almacenar información y darle un nombre para su uso posterior 13 | en el código. 14 | -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Реализуйте функцию с именем `print_motto()`, которая выведет на экран фразу *Winter is coming*. 2 | 3 | ```python 4 | print_motto() # => Winter is coming 5 | ``` 6 | 7 | В задачах, в которых нужно реализовать функцию, эту функцию вызывать не нужно. Вызывать функцию будут автоматизированные тесты, которые проверяют его работоспособность. Пример с вызовом выше показан только для того, чтобы вы понимали, как ваша функция будет использоваться. 8 | -------------------------------------------------------------------------------- /modules/50-loops/55-return-from-loops/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implement a function `is_contains_char()` that checks case-sensitively if a string contains a specified letter. The function takes two parameters: 3 | 4 | * The line 5 | * Search letter 6 | 7 | ```python 8 | print(is_contains_char('Hexlet', 'H')) # => True 9 | print(is_contains_char('Hexlet', 'h')) # => False 10 | print(is_contains_char('Awesomeness', 'm')) # => True 11 | print(is_contains_char('Awesomeness', 'd')) # => False 12 | ``` 13 | -------------------------------------------------------------------------------- /modules/48-conditionals/description.en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Conditionals 4 | description: | 5 | The job of predicate functions is to get the answer to a question. However, this usually isn't enough; you often need to perform a certain action depending on the answer. If and if-else are Python constructions that allow programmers to choose the desired behavior of the program depending on different conditions, often skipping some instructions and executing others. We'll analyse them in practice in this module. 6 | -------------------------------------------------------------------------------- /modules/50-loops/10-while/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Modifica la función `print_reversed_numbers()` para que imprima los números en orden inverso. Para ello, debes ir desde el límite superior hasta el límite inferior. Es decir, el contador debe inicializarse con el valor máximo y, en el cuerpo del ciclo, debe disminuir hasta el límite inferior. 3 | 4 | Ejemplo de llamada y salida: 5 | 6 | ```python 7 | print_reversed_numbers(4) 8 | ``` 9 | 10 | ```text 11 | 4 12 | 3 13 | 2 14 | 1 15 | ¡finished! 16 | ``` 17 | -------------------------------------------------------------------------------- /modules/50-loops/23-aggregation-strings/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Реализуйте функцию `join_numbers_from_range()`, которая объединяет все числа из переданного диапазона в строку: 2 | 3 | ```python 4 | join_numbers_from_range(1, 1) # '1' 5 | join_numbers_from_range(2, 3) # '23' 6 | join_numbers_from_range(5, 10) # '5678910' 7 | ``` 8 | 9 | ### Подсказки 10 | 11 | * Итоговый результат - строка. 12 | * С помощью функции [str()](https://docs.python.org/3/library/stdtypes.html#str) преобразуйте число в строку. 13 | -------------------------------------------------------------------------------- /modules/50-loops/55-return-from-loops/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Реализуйте функцию `is_contains_char()`, которая проверяет с учётом регистра, содержит ли переданная строка указанную букву. Функция принимает два параметра: 2 | 3 | * Строка 4 | * Буква для поиска 5 | 6 | ```python 7 | print(is_contains_char('Hexlet', 'H')) # => True 8 | print(is_contains_char('Hexlet', 'h')) # => False 9 | print(is_contains_char('Awesomeness', 'm')) # => True 10 | print(is_contains_char('Awesomeness', 'd')) # => False 11 | ``` 12 | -------------------------------------------------------------------------------- /modules/38-objects/200-methods-immutability/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Los datos ingresados por los usuarios a menudo contienen espacios en blanco adicionales al principio o al final de la cadena. Por lo general, se eliminan utilizando el método [.strip()](https://docs.python.org/3/library/stdtypes.html). Por ejemplo, si teníamos: `' hello\n '`, ahora tenemos: `'hello'`. 3 | 4 | Actualiza la variable `first_name`, asignándole el mismo valor pero procesado con el método `.strip()`. Imprime en pantalla el resultado obtenido. 5 | -------------------------------------------------------------------------------- /modules/48-conditionals/60-ternary-operator/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implemente la función `flip_flop()`, que recibe una cadena como entrada y, si esa cadena es igual a `'flip'`, devuelve la cadena `'flop'`. De lo contrario, la función debe devolver `'flip'`. 3 | 4 | Ejemplos de llamadas: 5 | 6 | ```python 7 | print(flip_flop('flip')) # => 'flop' 8 | print(flip_flop('flop')) # => 'flip' 9 | ``` 10 | 11 | Intente escribir dos versiones de la función: una con un if-else normal y otra con un operador ternario. 12 | -------------------------------------------------------------------------------- /modules/50-loops/10-while/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Modify the function `print_reversed_numbers()` so that it prints the numbers in reverse order. To do this, go from the upper bound to the lower bound. In other words, you should initialize the counter with the maximum value, and in the loop body, you should iterate it backwards down to the lower limit. 3 | 4 | Example call and output: 5 | 6 | ```python 7 | print_reversed_numbers(4) 8 | ``` 9 | 10 | ```text 11 | 4 12 | 3 13 | 2 14 | 1 15 | finished! 16 | ``` 17 | -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Statements 3 | tips: 4 | - > 5 | [A little bit about 6 | interpreters](https://en.wikipedia.org/wiki/Interpreter_(computing)) 7 | definitions: 8 | - name: Interpreter 9 | description: | 10 | a program that runs code in Python. 11 | - name: Statement 12 | description: >- 13 | a command for the computer written in a programming language. Python code 14 | is a set of instructions, most often separated by a line break. 15 | -------------------------------------------------------------------------------- /modules/20-arithmetics/27-commutativity/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Operación conmutativa 3 | tips: 4 | - > 5 | [Más información sobre la 6 | conmutatividad](https://es.wikipedia.org/wiki/Conmutatividad) 7 | definitions: 8 | - name: Conmutatividad 9 | description: > 10 | propiedad de una operación en la que el cambio de orden de los operandos 11 | no afecta al resultado. Por ejemplo, la suma es una operación conmutativa: 12 | la suma no cambia al cambiar el orden de los sumandos. 13 | -------------------------------------------------------------------------------- /modules/40-define-functions/600-type-annotations/test_code.py: -------------------------------------------------------------------------------- 1 | import index 2 | 3 | 4 | def test(): 5 | expected = [str, int, str] 6 | annotations = index.word_multiply.__annotations__ 7 | print(annotations) 8 | assert list(annotations.values()) == expected, "You should use type annotations!" # noqa: E501 9 | 10 | assert index.word_multiply("python", 1) == "python" 11 | assert index.word_multiply("python", 3) == "pythonpythonpython" 12 | assert index.word_multiply("java", 0) == "" 13 | -------------------------------------------------------------------------------- /modules/45-logic/25-logical-operators/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Логические операторы 3 | tips: 4 | - | 5 | [Булева алгебра](https://ru.wikipedia.org/wiki/Булева_алгебра) 6 | - | 7 | [Логическое «И»](https://ru.wikipedia.org/wiki/Конъюнкция) 8 | - | 9 | [Логическое «ИЛИ»](https://ru.wikipedia.org/wiki/Дизъюнкция) 10 | definitions: 11 | - name: Логические операторы 12 | description: >- 13 | операторы «И» (`and`), ИЛИ (`or`), позволяющие создавать составные 14 | логические условия. 15 | -------------------------------------------------------------------------------- /modules/50-loops/80-for-in-range/index.py: -------------------------------------------------------------------------------- 1 | def fizzbuzz(n: int) -> str: 2 | result = "" 3 | for i in range(1, n + 1): 4 | if i % 3 == 0 and i % 5 == 0: 5 | word = "FizzBuzz" 6 | elif i % 3 == 0: 7 | word = "Fizz" 8 | elif i % 5 == 0: 9 | word = "Buzz" 10 | else: 11 | word = str(i) 12 | 13 | if result == "": 14 | result = word 15 | else: 16 | result += " " + word 17 | return result 18 | -------------------------------------------------------------------------------- /modules/40-define-functions/100-define-function/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa una función llamada `print_motto()` que mostrará en la pantalla la frase *Winter is coming*. 3 | 4 | ```python 5 | print_motto() # => Winter is coming 6 | ``` 7 | 8 | En los ejercicios en los que se requiere implementar una función, no es necesario llamar a esa función. Las pruebas automatizadas se encargarán de llamarla y verificar su funcionalidad. El ejemplo de llamada anterior se muestra solo para que comprendas cómo se utilizará tu función. 9 | -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/ru/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Инструкции (Statements) 3 | tips: 4 | - | 5 | [Немного об интерпретаторах](https://ru.wikipedia.org/wiki/Интерпретатор) 6 | definitions: 7 | - name: Интерпретатор 8 | description: | 9 | программа, выполняющая код на Python. 10 | - name: Инструкция (statement) 11 | description: >- 12 | команда для компьютера, написанная на языке программирования. Код на 13 | Python — это набор инструкций, разделенных (чаще всего) переводом строки. 14 | -------------------------------------------------------------------------------- /modules/10-basics/40-testing/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Cómo verificamos tus soluciones 3 | definitions: 4 | - name: Pruebas 5 | description: >- 6 | códigos especiales que verifican la veracidad y nivel de corrección de los 7 | programas comparando el resultado obtenido al ejecutar el programa con el 8 | resultado esperado. 9 | tips: 10 | - | 11 | [TDD](https://es.wikipedia.org/wiki/Desarrollo_guiado_por_pruebas) 12 | - | 13 | [Comunidad de Hexlet en Telegram](https://t.me/hexletcommunity) 14 | -------------------------------------------------------------------------------- /modules/10-basics/50-syntax-errors/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Errores de sintaxis 3 | tips: 4 | - > 5 | [Tipos de errores en 6 | Python](https://docs.python.org/3/library/exceptions.html#exception-hierarchy) 7 | definitions: 8 | - name: Error de sintaxis 9 | description: violación de las reglas gramaticales del lenguaje de programación. 10 | - name: SyntaxError (error de análisis) 11 | description: >- 12 | tipo de errores en Python que ocurren cuando hay errores de sintaxis en el 13 | código. 14 | -------------------------------------------------------------------------------- /modules/30-variables/23-constants/en/README.md: -------------------------------------------------------------------------------- 1 | 2 | Some data never change - for example, mathematical constants. Take π as an example. It is always 3.14 and cannot change. Python uses constants to refer to this kind of data: 3 | 4 | ```python 5 | PI = 3.14 6 | print(PI) # => 3.14 7 | ``` 8 | 9 | A constant is created in the same way as a variable. The only difference is that constants are usually named with capital letters have and `_` as a separator between words. A constant, like a variable, can be used in any expression. 10 | -------------------------------------------------------------------------------- /modules/48-conditionals/description.es.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Estructuras condicionales 4 | description: | 5 | La tarea de una función booleana es obtener una respuesta a una pregunta, pero generalmente esto no es suficiente y es necesario realizar una acción específica dependiendo de la respuesta. If y if-else son construcciones en Python que permiten al programador elegir el comportamiento necesario del programa según diferentes condiciones: omitir algunas instrucciones y ejecutar otras. Las estudiaremos en la práctica en este módulo. 6 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | С помощью среза строк получите часть предложения, записанного в переменную `text`, с 5 по 15 символы включительно. Полученную подстроку обработайте методом `.strip()` и выведите на экран длину итоговой подстроки. Выполните эти операции подряд в цепочке без создания промежуточных переменных. 2 | 3 | ### Подсказки 4 | 5 | * Индексы в срезе начинаются с 0. То есть например 4 символ будет идти под индексом `3`. 6 | * Первый индекс среза не включается. Например, `text[4:6]` вернет, 5 и 6 символы. 7 | -------------------------------------------------------------------------------- /modules/50-loops/55-return-from-loops/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | 2 | Implementa la función `is_contains_char()`, que verifica, considerando mayúsculas y minúsculas, si una cadena contiene una letra específica. La función recibe dos parámetros: 3 | 4 | * La cadena 5 | * La letra a buscar 6 | 7 | ```python 8 | print(is_contains_char('Hexlet', 'H')) # => True 9 | print(is_contains_char('Hexlet', 'h')) # => False 10 | print(is_contains_char('Awesomeness', 'm')) # => True 11 | print(is_contains_char('Awesomeness', 'd')) # => False 12 | ``` 13 | -------------------------------------------------------------------------------- /modules/25-strings/30-encoding/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Найдите в таблице ASCII номера для символов ~, ^ и %. 2 | С помощью функции `chr()` выведите их на экран так, чтобы каждый символ был напечатан в отдельной строке. 3 | 4 | ```python 5 | print(chr(...)) 6 | print(chr(...)) 7 | print(chr(...)) 8 | ``` 9 | 10 | Допустим, мы нашли в таблице ASCII, что символ ? имеет номер 63. Тогда программа ниже выведет `?`: 11 | 12 | ```python 13 | print(chr(63)) # вывод: ? 14 | ``` 15 | 16 | По такому же принципу вам нужно найти номера для ~, ^ и % и вывести их. 17 | -------------------------------------------------------------------------------- /modules/33-data-types/52-data-types-immutability/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Вам даны три переменные с фамилиями разных людей. Составьте и выведите на экран слово из символов в таком порядке: 2 | 3 | 1. Третий символ из первой строки 4 | 2. Второй символ из второй строки 5 | 3. Четвертый символ из третьей строки 6 | 4. Пятый символ из второй строки 7 | 5. Третий символ из второй строки 8 | 9 | Попробуйте использовать интерполяцию (f-строки): внутри фигурных скобок можно помещать не только целые переменные, но и отдельные символы с помощью квадратных скобок. 10 | -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/en/README.md: -------------------------------------------------------------------------------- 1 | Learning a new programming language traditionally begins with 'Hello, world!'. It is a simple program that both displays a greeting on the screen, and introduces the new language, showing its syntax and its program structure. 2 | 3 | ```text 4 | Hello, World! 5 | ``` 6 | 7 | This tradition is over forty years old, so we're not thinking of breaking it any time soon. In the first lesson, we'll write a program called `Hello, world!`. To do this, you have to give the computer a special command. In Python, it's: `print()`. 8 | -------------------------------------------------------------------------------- /modules/10-basics/10-hello-world/es/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Escribe en el editor el código del ejercicio, carácter por carácter, y luego haz clic en "Verificar". 2 | 3 | ```python 4 | print('Hello, World!') 5 | ``` 6 | 7 | Atención: si escribes `heLLo, woRld!` en lugar de `Hello, World!`, el sistema lo considerará un texto diferente, ya que el tamaño de la letra implica el uso de caracteres diferentes que difieren en _mayúsculas y minúsculas_. En programación, la capitalización casi siempre importa, así que acostúmbrate a prestarle siempre atención a esos pequeños detalles. 8 | -------------------------------------------------------------------------------- /modules/45-logic/25-logical-operators/en/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Logical operators 3 | tips: 4 | - | 5 | [Boolean algebra](https://en.wikipedia.org/wiki/Boolean_algebra_(structure)) 6 | - | 7 | [Logical conjunction](https://en.wikipedia.org/wiki/Logical_conjunction) 8 | - | 9 | [Logical disjunction](https://en.wikipedia.org/wiki/Logical_disjunction) 10 | definitions: 11 | - name: Logical operators. 12 | description: >- 13 | the AND (`and`), OR (`or`) operators, which allow you to create compound 14 | logical conditions. 15 | -------------------------------------------------------------------------------- /modules/10-basics/30-instructions/es/data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Instrucciones 3 | tips: 4 | - > 5 | [Más información sobre los 6 | intérpretes](https://es.wikipedia.org/wiki/Int%C3%A9rprete) 7 | definitions: 8 | - name: Intérprete 9 | description: | 10 | un programa que ejecuta código en Python. 11 | - name: Instrucción 12 | description: >- 13 | un comando para el ordenador escrito en un lenguaje de programación. El 14 | código en Python es un conjunto de instrucciones separadas (generalmente) 15 | por saltos de línea. 16 | -------------------------------------------------------------------------------- /modules/20-arithmetics/description.ru.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Арифметика в Python 4 | description: 5 | Современные программы создаются для обслуживания бизнесов, помощи в ежедневной жизни и развлечений. Но в основе их работы по-прежнему лежат вычисления. Наиболее простая и базовая тема в программировании — арифметика. В этом модуле мы переведем арифметические действия на язык программирования, освоим базовую терминологию – например, чем оператор отличается от операнды. Поговорим о приоритете операций. А под конец расскажем, что такое линтер и почему он может «ругаться». 6 | -------------------------------------------------------------------------------- /modules/35-calling-functions/description.ru.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Вызов функций 4 | description: 5 | Для выражения любой произвольной операции в программировании существует понятие «функция». Функции — кирпичики, из которых программисты строят системы. В этом модуле мы научимся пользоваться уже созданными функциями. Посмотрим на сигнатуру функции в документации и разберемся, как её использовать. Познакомимся со стандартными библиотеками, которые хранят тысячи функций. Все функции невозможно выучить, но каждый программист должен знать, где искать документацию по ним. 6 | -------------------------------------------------------------------------------- /modules/38-objects/description.ru.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Свойства и методы 4 | description: | 5 | Данные, которыми мы оперируем в своих программах, могут обладать важными атрибутами. В Python атрибуты встроены прямо в язык. Кроме статических свойств у данных существуют методы — функции, находящиеся внутри свойств. Свойства и методы — такие же выражения, как переменные или вызовы функции, а значит, их можно всячески комбинировать. Глубже эти темы разбираются на отдельных курсах, посвященных объектно-ориентированным возможностям Python. Мы же в этом модуле изучим основы. 6 | -------------------------------------------------------------------------------- /modules/50-loops/70-for/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | В одном из предыдущих уроков мы уже написали функцию `filter_string()`. Напомним, она принимает на вход строку и символ и возвращает новую строку, в которой удалён переданный символ во всех его позициях. На этот раз реализуйте эту функцию с помощью цикла `for`. Дополнительное условие: регистр исключаемого символа не имеет значения. 2 | 3 | Пример вызова: 4 | 5 | ```python 6 | text = 'If I look forward I win' 7 | filter_string(text, 'i') # 'f look forward wn' 8 | filter_string(text, 'O') # 'If I lk frward I win' 9 | ``` 10 | -------------------------------------------------------------------------------- /modules/38-objects/500-method-chain/ru/EXERCISE.md: -------------------------------------------------------------------------------- 1 | Возьмите часть строки, записанной в переменной `text`, с **5 по 15 символ включительно**. Затем удалите лишние пробелы по краям методом `.strip()` и выведите на экран **длину получившейся строки**. 2 | 3 | Все действия выполните **в одной цепочке** — без создания промежуточных переменных. 4 | 5 | ### Подсказки 6 | 7 | * Индексы в строках начинаются с нуля. Например, 4-й символ имеет индекс `3`. 8 | * При работе со срезами первый индекс **включается**, а второй — **нет**. Например, `text[4:6]` вернёт 5-й и 6-й символы строки. 9 | -------------------------------------------------------------------------------- /modules/20-arithmetics/description.en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Arithmetic in Python 4 | description: 5 | Today's programs are created to serve businesses, help with daily life, and entertain. But they are still based on computation. The simplest and most basic subject in programming is arithmetic. In this module we will translate arithmetic operations into programming language, master the basic terminology - for example, how an operator differs from an operand. We will talk about the priority of operations. And at the end we will tell you what a linter is and why it can "swear". 6 | -------------------------------------------------------------------------------- /modules/33-data-types/52-data-types-immutability/en/EXERCISE.md: -------------------------------------------------------------------------------- 1 | You are given three variables with the names of different people. Make and display a word of characters in this order: 2 | 3 | 1. The third character from the first line 4 | 2. The second character from the second line 5 | 3. The fourth character from the third line 6 | 4. The fifth character of the second line 7 | 5. The third character from the second line 8 | 9 | Try using interpolation: not only whole variables can be placed inside curly brackets, but also individual characters using square brackets. 10 | --------------------------------------------------------------------------------