Get startedGet started for free

Using flake8 to tidy up a file

You have just written a module for calculating the absolute value of a given number. It's passing all your tests, but you are concerned that it does not conform to proper style guidelines. Sticking to style guidelines means your users, collaborators, and you, will be able to read and understand your code more easily.

As the Zen of Python states,

Readability counts.

In this exercise, you will use flake8 to point out style violations and fix them.

This exercise is part of the course

Developing Python Packages

View Course

Exercise instructions

  • Using the terminal, run flake8 on the absolute.py module.
  • Use the feedback from flake8 to bring the code into line with PEP8. You must fix the issues for the submission to be marked correct.

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise