0

What Is PEP 8 ?

can you explain

9th Sep 2020, 4:55 AM
tushar ladva
tushar ladva - avatar
3 Antworten
+ 3
PEP 8 is a code styling guide for Python. It guides Python developers on many things that will affect readability and consistency of code. These are things like: - lines of code shouldn't be more than 80 characters. - Functions that aren't indented at all(not methods) should have 2 blank lines between them. - case for function names should be snake case. There are many more suggestions that I can't remember. I think most teams using Python tend to adopt several and follow them perfectly while some PEP 8 recommendations get virtually ignored. It is a bunch of stuff that helps everyone's code look like it was written by the same developer even if it was written by a team. Breaking a PEP 8 suggestion will never stop your Python script from running but some code editors may highlight the affected lines and sometimes a teammate will get mildly annoyed by it. Check out the official PEP 8 documentation at: https://www.python.org/dev/peps/pep-0008/
9th Sep 2020, 5:23 AM
Josh Greig
Josh Greig - avatar
+ 1
Python Enhanced Proposal 8 (PEP 8) provides standards and guidelines of how best to write python code
25th Feb 2023, 4:19 AM
Izaiah Kay
Izaiah Kay - avatar
0
What is PEP 8?
24th Feb 2023, 11:42 PM
Gerson Flores