Using the "black" code formatter in Python

Using the "black" code formatter in Python

Assessment

Interactive Video

Architecture, Information Technology (IT)

University

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

The video tutorial introduces Black, a code formatter for Python, highlighting its widespread adoption despite being in beta. Black is unique as it has no settings, ensuring consistent formatting across codebases, which enhances readability and reduces cognitive load for developers. It adheres to a strict subset of the Python style guide, maintaining code within 88 characters per line and normalizing various elements. While Black has configurable parameters, they are rarely needed, as the default settings are generally sufficient.

Read more

2 questions

Show all answers

1.

OPEN ENDED QUESTION

3 mins • 1 pt

Describe how Black handles long lines of code or function signatures.

Evaluate responses using AI:

OFF

2.

OPEN ENDED QUESTION

3 mins • 1 pt

What are some configurable parameters in Black, and when might you use them?

Evaluate responses using AI:

OFF

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?