From d83e227af4d4daf59d31ce2a01ac3cadfc2e8f82 Mon Sep 17 00:00:00 2001 From: dwrz Date: Fri, 12 Nov 2021 21:16:11 +0000 Subject: [PATCH] Add python/two-fer --- python/two-fer/HELP.md | 55 ++++++++++++++++++ python/two-fer/README.md | 54 +++++++++++++++++ .../__pycache__/two_fer.cpython-39.pyc | Bin 0 -> 480 bytes .../two_fer_test.cpython-39-pytest-6.2.5.pyc | Bin 0 -> 1091 bytes python/two-fer/two_fer.py | 7 +++ python/two-fer/two_fer_test.py | 22 +++++++ 6 files changed, 138 insertions(+) create mode 100644 python/two-fer/HELP.md create mode 100644 python/two-fer/README.md create mode 100644 python/two-fer/__pycache__/two_fer.cpython-39.pyc create mode 100644 python/two-fer/__pycache__/two_fer_test.cpython-39-pytest-6.2.5.pyc create mode 100644 python/two-fer/two_fer.py create mode 100644 python/two-fer/two_fer_test.py diff --git a/python/two-fer/HELP.md b/python/two-fer/HELP.md new file mode 100644 index 0000000..3df0546 --- /dev/null +++ b/python/two-fer/HELP.md @@ -0,0 +1,55 @@ +# Help + +## Running the tests + +To run the included *tests*, run the test file using the `pytest` module, replacing `{exercise_name}`: + +```bash +$ python3 -m pytest {exercise_name}_test.py +``` + +Many IDE's and code editors have built-in support for using Pytest to run tests; check them out [here](https://github.com/exercism/python/blob/main/docs/TOOLS.md#editors-and-ides). + +For more information about running tests using `pytest`, checkout our [Python testing guide](https://github.com/exercism/python/blob/main/docs/TESTS.md#pytest). + +### Common pytest options + +- `-v` : enable verbose output. +- `-x` : stop running tests on first failure. +- `--ff` : run failures from previous test before running other test cases. + +For other options, see `python3 -m pytest -h`. + +## Submitting your solution + +You can submit your solution using the `exercism submit two_fer.py` command. +This command will upload your solution to the Exercism website and print the solution page's URL. + +It's possible to submit an incomplete solution which allows you to: + +- See how others have completed the exercise +- Request help from a mentor + +## Need to get help? + +If you'd like help solving the exercise, check the following pages: + +- The [Python track's documentation](https://exercism.org/docs/tracks/python) +- [Exercism's support channel on gitter](https://gitter.im/exercism/support) +- The [Frequently Asked Questions](https://exercism.org/docs/using/faqs) + +Should those resources not suffice, you could submit your (incomplete) solution to request mentoring. + +Below are some resources for getting help if you run into trouble: + +- [The PSF](https://www.python.org) hosts Python downloads, documentation, and community resources. +- [Python Community on Discord](https://pythondiscord.com/) is a very helpful and active community. +- [#python on Libera.chat](https://www.python.org/community/irc/) this is where the cored developers for the language hang out and get work done. +- [Exercism on Gitter](https://gitter.im/exercism/home) join the Python room for Python-related questions or problems. +- [/r/learnpython/](https://www.reddit.com/r/learnpython/) is a subreddit designed for Python learners. +- [Python Community Forums](https://discuss.python.org/) +- [Pythontutor](http://pythontutor.com/) for stepping through small code snippets visually. + + +Additionally, [StackOverflow](http://stackoverflow.com/questions/tagged/python) is a good spot to search for your problem/question to see if it has been answered already. + If not - you can always [ask](https://stackoverflow.com/help/how-to-ask) or [answer](https://stackoverflow.com/help/how-to-answer) someone else's question. \ No newline at end of file diff --git a/python/two-fer/README.md b/python/two-fer/README.md new file mode 100644 index 0000000..c49331d --- /dev/null +++ b/python/two-fer/README.md @@ -0,0 +1,54 @@ +# Two Fer + +Welcome to Two Fer on Exercism's Python Track. +If you need help running the tests or submitting your code, check out `HELP.md`. + +## Instructions + +`Two-fer` or `2-fer` is short for two for one. One for you and one for me. + +Given a name, return a string with the message: + +```text +One for name, one for me. +``` + +Where "name" is the given name. + +However, if the name is missing, return the string: + +```text +One for you, one for me. +``` + +Here are some examples: + +|Name |String to return +|:-------|:------------------ +|Alice |One for Alice, one for me. +|Bob |One for Bob, one for me. +| |One for you, one for me. +|Zaphod |One for Zaphod, one for me. + +## Source + +### Created by + +- @samwincott + +### Contributed to by + +- @cmccandless +- @denislooby +- @Dog +- @Grociu +- @ikhadykin +- @mikeyny +- @N-Parsons +- @tqa236 +- @xarxziux +- @yawpitch + +### Based on + +https://github.com/exercism/problem-specifications/issues/757 \ No newline at end of file diff --git a/python/two-fer/__pycache__/two_fer.cpython-39.pyc b/python/two-fer/__pycache__/two_fer.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e933568a9e65960ad70c6b655489ace8f9660981 GIT binary patch literal 480 zcmY*W%}&EG3{HQ>rios70;{)5Tl)eCAtAvHB-m+}s%l(XscotxrL4e>GcSNRBOZj8 z=#{tNgwu_`PqJe>_GiaQJa5hjukTNZXEF9+oWF3$IVMpDq&QnMKH)ZZ9<8;--76OC z^=GTRP*4fpmI#d$Hw8xp3FuD58A{07I@N`!ArlfL>Q>f8eN73gPQWQ8C@m=v4$elj zDb4T$W1IdbBx;`&x9-_9U(`5ux`R5Y5FQpFc99B0e*s;N z62}U2KLz;Xr z-D4kv*YK4SufU0!gtmc#gs|kv%)~SPzAuyL;GjuhJ^%7K3M@jtVo+ZW1jn%RAs9gf zO-M+~rym_abxG(5S9lP+!iT2JG>3Eb zQtF}1ixI6gLmx?|sa!3{u%!TVX58 zbE%6L=d&o$h;2=clgnhhCfbMa`{VvZrLr&PdfAs3Kq$`B{&Z1HRMrQMkANdSkt;6% zU~jrGZFG31cowCSzl%T0tc4J