Skip to content

Commit 267eb02

Browse files
committed
Add indentation and imports sections
1 parent 9fd3f11 commit 267eb02

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

episodes/style-guide.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,20 @@ teaching: 5 # teaching time in minutes
44
exercises: 2 # exercise time in minutes
55
---
66

7-
here
7+
The [PEP 8 Style Guide for Python Code](https://peps.python.org/pep-0008/) gives coding conventions for code layout, comments, naming, and other programming recommendations. The [pep8.org](https://pep8.org/) website is another presentation of the style guide. By adhering to the Python style guide, developers can write consistent code that is readable and maintainable on small and large projects. Some of the major conventions suggested by the guide are demonstrated below but readers should review the PEP 8 guide for more information.
8+
9+
## Indentation
10+
11+
Use 4 spaces per indentation level and spaces are the preferred indentation method.
12+
13+
## Imports
14+
15+
Imports should be on separate lines except when using the from syntax. Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.
16+
17+
```python
18+
import os
19+
import sys
20+
21+
from subprocess import Popen, PIPE
22+
```
23+

0 commit comments

Comments
 (0)