Style Guide
De officiële stijlgids voor Python-code is PEP 8 (opens new window).
Encoding
Indenteren
Indenteer met 4 spaties per indenteringsniveau.
Goed
while True:
action = input('? ')
1
2
Fout
while True:
action = input('? ')
1
2
Line Break
Linebreaks voor de binaire operator.
Imports
Een lijn per import.
Goed
import datetime
import random
1
2
Fout
import datetime, random
1
Bronnen