Skip to content

Commit d3383e9

Browse files
committed
Merge pull request #293 from oalbe/master
Created LEARNING.md and TESTS.md.
2 parents 0e66d02 + f5a1529 commit d3383e9

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

docs/LEARNING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Learning Python From Scratch
2+
Python is, as Wikipedia goes, a powerful *general-purpose high-level programming language*. It basically means that it can be used to write a wide variety of different kinds of software, from videogames to HTTP servers to command-line tools.
3+
4+
One of the main characteristics that differentiates Python from other programming languages is its strong emphasis on readability and code cleaness. In fact, differently from other languages like JavaScript or C++, in Python code indentation has a syntactical meaning and you are forced to chose and adhere to a writing style (e.g. don't mix *tabs* and *spaces* for identation; don't use two spaces where you should use four etc.). Yes, forced: the Python interpreter will raise SyntaxErrors if it recognize wrong indentation.
5+
6+
This might look like a limit at the beginning but, as you will advance in your learning path, you'll realize that enforcing this behaviour will make your code slim and more readable by default.
7+
8+
For its own nature, exercism assumes that you already have a grasp of the language syntax before starting doing exercises. At least at a point where you can write simple functions in Python. From there on, you can continue your learning as you will advance in the exercism track and gradually explore new constructs and concepts.
9+
10+
With this premise, a good, beginner friendly, starting point for those who don't have any experience in other languages might be the Python course on [Codecademy.com](https://www.codecademy.com/). It will help you get an understanding of the Python syntax with which you will be able to start solving exercises here on exercism.
11+
12+
## Other Resources
13+
14+
- [Python3 Beginner Tutorial](https://www.youtube.com/playlist?list=PL1A2CSdiySGJd0LJRRSwQZbPZaDP0q67j)
15+
- [Learn Python The Hard Way (Book)](http://learnpythonthehardway.org/book/)
16+
- [Offical Python3 **Documentation** and **Reference**](https://docs.python.org/3/)
17+
- [Learn X in Y minutes (where X = Python3)](https://learnxinyminutes.com/docs/python3/)
18+
- [The Hitchhiker’s Guide to Python](http://docs.python-guide.org/en/latest/)

docs/TESTS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Installing `pytest`
2+
3+
First of all, install `pytest` through `pip`.
4+
```
5+
pip3 install pytest
6+
```
7+
In case your system wouldn't be able to find `pip` and return a _command not found_, response, [here](https://pip.pypa.io/en/stable/installing/) you can find a tutorial on how to install it.
8+
9+
# Running the Tests
10+
11+
To run the tests for a specific exercise (we will take the `bob.py` exercise as an example here), place yourself in the directory where that exercise has been fetched and run:
12+
13+
```
14+
pytest bob_test.py
15+
```
16+
17+
This will run all the tests, wethere they fail or not. If you'd rather stop the process and exit on the first failure, run:
18+
19+
```
20+
pytest -x bob_test.py
21+
```
22+
23+
**Note:** To run the tests you have to pass the name of the testsuite file to `pytest` (generally, the file ending with `_test.py`), **NOT** the file you created to solve the problem (which is, your _implementation_). This because in the latter case, since there are no defined test cases in your implementation, `pytest` will just return a positive result, specifying that it ran zero tests. Like this:
24+
25+
```
26+
============================= bob.py ==============================
27+
28+
----------------------------------------------------------------------
29+
30+
Ran 0 tests in 0.000s
31+
32+
OK
33+
```

0 commit comments

Comments
 (0)